Package edu.wisc.library.ocfl.core.util
Class PercentEscaper.Builder
- java.lang.Object
-
- edu.wisc.library.ocfl.core.util.PercentEscaper.Builder
-
- Enclosing class:
- PercentEscaper
public static class PercentEscaper.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PercentEscaper.BuilderaddSafeCharRange(char start, char end)Adds a range of characters to the set of characters that do not need to be encoded.PercentEscaper.BuilderaddSafeChars(String safeChars)Adds each character in the string to the set of characters that do not need to be encoded.PercentEscaper.BuilderaddUnsafeCharRange(char start, char end)Adds a range of characters to the set of characters that need to be encoded.PercentEscaper.BuilderaddUnsafeChars(String unsafeChars)Adds each character in the string to the set of characters that need to be encoded.PercentEscaperbuild()PercentEscaper.BuilderplusForSpace(boolean plusForSpace)PercentEscaper.BuilderuseUppercase(boolean useUppercase)
-
-
-
Method Detail
-
addSafeCharRange
public PercentEscaper.Builder addSafeCharRange(char start, char end)
Adds a range of characters to the set of characters that do not need to be encoded.- Parameters:
start- the first safe character in the rangeend- the last safe character in the range- Returns:
- this
-
addSafeChars
public PercentEscaper.Builder addSafeChars(String safeChars)
Adds each character in the string to the set of characters that do not need to be encoded.- Parameters:
safeChars- characters that do not need to be encoded- Returns:
- this
-
addUnsafeCharRange
public PercentEscaper.Builder addUnsafeCharRange(char start, char end)
Adds a range of characters to the set of characters that need to be encoded.- Parameters:
start- the first unsafe character in the rangeend- the last unsafe character in the range- Returns:
- this
-
addUnsafeChars
public PercentEscaper.Builder addUnsafeChars(String unsafeChars)
Adds each character in the string to the set of characters that need to be encoded.- Parameters:
unsafeChars- characters that need to be encoded- Returns:
- this
-
plusForSpace
public PercentEscaper.Builder plusForSpace(boolean plusForSpace)
- Parameters:
plusForSpace- true if ASCII space should be escaped to+rather than%20- Returns:
- this
-
useUppercase
public PercentEscaper.Builder useUppercase(boolean useUppercase)
- Parameters:
useUppercase- true if hex characters should be upper case- Returns:
- this
-
build
public PercentEscaper build()
-
-