-
public interface TokenConverterAn object capable of converting tokens into other formats. While the interface is generically typed, usingTokenValued, implementations are generally type specific, working on only tokens of one type.- See Also:
TokenConverters
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intasHashCode()Computes a hash code for the source token value.ObjectasObject()Creates anObjectrepresentation of the source value.StringasString()Creates a string representation of the source value, suitable for displaying to users.DataTokenasToken()Creates an immutable copy of the source value.voidsetSource(TokenValued value)Sets the source value for this converter.
-
-
-
Method Detail
-
setSource
void setSource(TokenValued value)
Sets the source value for this converter.- Parameters:
value- the source of values to be converted
-
asToken
DataToken asToken()
Creates an immutable copy of the source value.- Returns:
- an immutable token holding the same token value
-
asObject
Object asObject()
Creates anObjectrepresentation of the source value. The type of the object returned depends on the token type.Token Type Object Type BINARY byte array BOOLEAN BooleanCHAR CharacterDATE Date(time portion will be midnight)DOUBLE DoubleENUM StringFLOAT FloatINT IntegerIP4ADDRESS Inet4AddressIP6ADDRESS Inet6AddressLONG LongNUMERIC BigDecimalOBJECT ObjectRECORD MapSTRING StringTIMESTAMP Date(date portion will by January 1, 1970)TIMESTAMP TimestampA
nullobject reference is returned if the current token value is null.- Returns:
- an
Objectcontaining the current token value
-
asString
String asString()
Creates a string representation of the source value, suitable for displaying to users.- Returns:
- the formatted value
-
asHashCode
int asHashCode()
Computes a hash code for the source token value. Two token values reported equal byTokenComparator.equal()will always generate the same hash code.- Returns:
- a computed hash code for the value
-
-