Package com.helger.commons.format
Class FormatableObject<DATATYPE>
- java.lang.Object
-
- com.helger.commons.format.FormatableObject<DATATYPE>
-
- Type Parameters:
DATATYPE- Data type to be formatted
- All Implemented Interfaces:
IFormatableObject<DATATYPE>
@NotThreadSafe public class FormatableObject<DATATYPE> extends Object implements IFormatableObject<DATATYPE>
This class represents a single object with an additional formatter.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description FormatableObject(DATATYPE aValue, Function<? super DATATYPE,? extends String> aFormatter)Init the field with a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Function<? super DATATYPE,? extends String>getFormatter()DATATYPEgetValue()Get the original value.inthashCode()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.format.IFormatableObject
getAsString
-
-
-
-
Method Detail
-
getValue
@Nullable public DATATYPE getValue()
Description copied from interface:IFormatableObjectGet the original value.- Specified by:
getValuein interfaceIFormatableObject<DATATYPE>- Returns:
- The unformatted value. May be
null.
-
getFormatter
@Nullable public Function<? super DATATYPE,? extends String> getFormatter()
- Specified by:
getFormatterin interfaceIFormatableObject<DATATYPE>- Returns:
- The formatter to be used for formatting this object. Never
null.
-
-