public class BooleanDatatype extends AbstractDatatype<Boolean>
Datatype.Builtin, Datatype.Default
Constructor and Description |
---|
BooleanDatatype() |
Modifier and Type | Method and Description |
---|---|
String |
getString(Boolean value)
Transforms a value supported by this datatype into a string representation.
|
boolean |
isHandlingJavaType(Class type) |
Boolean |
valueOf(String s)
Transforms a string representation into a value of the supported type.
|
getBuiltin, getDisplayString, getValueType, isValid, setBuiltin, toString
public boolean isHandlingJavaType(Class type)
isHandlingJavaType
in interface Datatype<Boolean>
isHandlingJavaType
in class AbstractDatatype<Boolean>
true
if this datatype can handle values of the given Java type.public Boolean valueOf(String s) throws InvalidValueException
Datatype
valueOf
in interface Datatype<Boolean>
valueOf
in class AbstractDatatype<Boolean>
s
- The string representation of a value.null
if the string was null
or empty.InvalidValueException
- If the string couldn't be parsed.public String getString(Boolean value) throws InvalidValueException
Datatype
This method calls Datatype.isValid(Object)
before converting the value, it throws
an exception if validation fails.
getString
in interface Datatype<Boolean>
getString
in class AbstractDatatype<Boolean>
value
- The value to transform.null
.InvalidValueException
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.