public final class BooleanConverter extends AbstractConverter<Boolean>
Converter
implementation for the
java.lang.Boolean
type.ConverterFactory.forBoolean(Class, String)
Modifier and Type | Field and Description |
---|---|
static BooleanConverter |
OBJECT
BooleanConverter object type instance. |
static BooleanConverter |
SIMPLE
BooleanConverter primitive type instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
constants argument that contains set of allowed
boolean constants. |
protected <T> Boolean |
doDecode(String value,
ValidationContext<T> context)
Converts string representation of boolean value into
java.lang.Boolean object. |
protected <T> String |
doEncode(Boolean value,
ValidationContext<T> context)
Converts
java.lang.Boolean object into string
representation. |
Class<Boolean> |
getType()
Returns
java.lang.Boolean type. |
decode, encode
getMessageTemplate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageTemplate
public static final BooleanConverter SIMPLE
BooleanConverter
primitive type instance.public static final BooleanConverter OBJECT
BooleanConverter
object type instance.public Class<Boolean> getType()
java.lang.Boolean
type.java.lang.Boolean
type.public boolean appendMessageArguments(ValidationContext<?> context, Map<String,Object> arguments)
constants
argument that contains set of allowed
boolean constants.appendMessageArguments
in interface Converter<Boolean>
appendMessageArguments
in interface Validation<Boolean>
appendMessageArguments
in class AbstractValidation<Boolean>
context
- Validation context.arguments
- Arguments to be substituted into the error message
template.true
.protected <T> Boolean doDecode(String value, ValidationContext<T> context)
java.lang.Boolean
object.doDecode
in class AbstractConverter<Boolean>
T
- The type of validated entity.value
- String representation of boolean value.context
- Validation context.java.lang.Boolean
object.MalformedValueException
- if the specified string could not be
parsed as a boolean.protected <T> String doEncode(Boolean value, ValidationContext<T> context)
java.lang.Boolean
object into string
representation.doEncode
in class AbstractConverter<Boolean>
T
- The type of validated entity.value
- java.lang.Boolean
object to be encoded.context
- Validation context.Copyright © 2011–2020 FoxLabs. All rights reserved.