public class BooleanFormatter extends AbstractFormatter<java.lang.Boolean>
| Modifier and Type | Field and Description |
|---|---|
static BooleanFormatter |
BOOL |
static java.lang.String |
DEFAULT_PATTERN |
static java.lang.String |
PATTERN_BOOL |
static java.lang.String |
PATTERN_QUERY |
static java.lang.String |
PATTERN_SWITCH |
static BooleanFormatter |
QUERY |
static BooleanFormatter |
SWITCH |
| Modifier | Constructor and Description |
|---|---|
|
BooleanFormatter() |
protected |
BooleanFormatter(java.lang.String pattern) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(java.lang.Boolean value)
Formats an instance into its literal representation.
|
static BooleanFormatter |
getInstance(java.lang.String pattern) |
java.lang.String |
getPattern() |
java.lang.Boolean |
parse(java.lang.String str)
Parses a literal representation into an instance of type
T. |
static java.lang.Boolean |
parseBoolean(java.lang.String str) |
parseError, parseError, parseHexInt, parseHexIntpublic static final java.lang.String PATTERN_BOOL
public static final java.lang.String PATTERN_QUERY
public static final java.lang.String PATTERN_SWITCH
public static final java.lang.String DEFAULT_PATTERN
public static final BooleanFormatter BOOL
public static final BooleanFormatter QUERY
public static final BooleanFormatter SWITCH
public BooleanFormatter()
protected BooleanFormatter(@Nullable
java.lang.String pattern)
@Nonnull public static BooleanFormatter getInstance(@Nullable java.lang.String pattern)
@Nonnull public java.lang.String getPattern()
@Nullable
public static java.lang.Boolean parseBoolean(@Nullable
java.lang.String str)
throws ParseException
ParseException@Nullable
public java.lang.String format(@Nullable
java.lang.Boolean value)
FormatterFormats an instance into its literal representation.
The resulting String may be set as an argument to Formatter.parse(java.lang.String)
resulting in a similar instance as the input.
value - the instance to be formattedString representing the instance's state.@Nullable
public java.lang.Boolean parse(@Nullable
java.lang.String str)
throws ParseException
FormatterParses a literal representation into an instance of type T.
The resulting instance T may be set as an argument to Formatter.format(T)
resulting in an equal String as the input.
str - the String to be parsedT whose state is initialized given the
parameters of the input String.ParseException - if the String cannot be parsed.