DATATYPE - Data type to be formatted@NotThreadSafe public class FormatableObject<DATATYPE> extends Object implements IFormatableObject<DATATYPE>
| Constructor and Description |
|---|
FormatableObject(DATATYPE aValue,
IFormatter<DATATYPE> aFormatter)
Init the field with a value.
|
FormatableObject(DATATYPE aValue,
IHasFormatter<DATATYPE> aFormatterProvider)
Init the field with a value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getAsString()
Get the value converted to a string with the specified formatter.
|
IFormatter<DATATYPE> |
getFormatter() |
DATATYPE |
getValue()
Get the original value.
|
int |
hashCode() |
String |
toString() |
public FormatableObject(@Nullable DATATYPE aValue, @Nullable IFormatter<DATATYPE> aFormatter)
aValue - The value to be used. May be null.aFormatter - The optional formatter to use. May be null.public FormatableObject(@Nullable DATATYPE aValue, @Nonnull IHasFormatter<DATATYPE> aFormatterProvider)
aValue - The value to be used. May be null.aFormatterProvider - The formatter provider to use. May not be null.@Nullable public DATATYPE getValue()
IFormatableObjectgetValue in interface IFormatableObject<DATATYPE>null.@Nullable public IFormatter<DATATYPE> getFormatter()
getFormatter in interface IFormatableObject<DATATYPE>null.@Nullable public String getAsString()
IFormatableObjectgetAsString in interface IFormatableObject<DATATYPE>null
dependent on the semantics of the formatter.Copyright © 2014–2016 Philip Helger. All rights reserved.