@NotThreadSafe public class FormatableObject extends Object implements IFormatableObject
| Constructor and Description |
|---|
FormatableObject(Object aValue,
IFormatter aFormatter)
Init the field with a value.
|
FormatableObject(Object aValue,
IHasFormatter 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 |
getFormatter() |
Object |
getValue()
Get the original value.
|
int |
hashCode() |
String |
toString() |
public FormatableObject(@Nullable Object aValue, @Nullable IFormatter aFormatter)
aValue - The value to be used. May be null.aFormatter - The optional formatter to use. May be null.public FormatableObject(@Nullable Object aValue, @Nonnull IHasFormatter aFormatterProvider)
aValue - The value to be used. May be null.aFormatterProvider - The formatter provider to use. May not be null.@Nullable public Object getValue()
IFormatableObjectgetValue in interface IFormatableObjectnull.@Nullable public IFormatter getFormatter()
getFormatter in interface IFormatableObjectnull.@Nullable public String getAsString()
IFormatableObjectgetAsString in interface IFormatableObjectgetAsString in interface IHasStringRepresentationnull
dependent on the semantics of the formatter.Copyright © 2014–2015 Philip Helger. All rights reserved.