T - the type the property type producespublic class PrimitivePropertyType<T> extends Object implements PropertyType<T>
| Modifier and Type | Field and Description |
|---|---|
static PropertyType<Boolean> |
BOOLEAN |
static PropertyType<Byte> |
BYTE |
static PropertyType<Double> |
DOUBLE |
static PropertyType<Float> |
FLOAT |
static PropertyType<Integer> |
INTEGER |
static PropertyType<Long> |
LONG |
static PropertyType<String> |
LOWERCASE_STRING |
static PropertyType<Short> |
SHORT |
static PropertyType<String> |
STRING |
| Constructor and Description |
|---|
PrimitivePropertyType(Function<Object,T> convertFunction)
Constructor.
|
PrimitivePropertyType(Function<Object,T> convertFunction,
Function<T,Object> exportValueFunction)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
convert(Object object)
Converts the given object (typically read from a property resource) to the given type, if possible.
|
Object |
toExportValue(T value)
Converts the given value to its export value.
|
public static final PropertyType<Long> LONG
public static final PropertyType<Integer> INTEGER
public static final PropertyType<Double> DOUBLE
public static final PropertyType<Float> FLOAT
public static final PropertyType<Short> SHORT
public static final PropertyType<Byte> BYTE
public static final PropertyType<Boolean> BOOLEAN
public static final PropertyType<String> STRING
public static final PropertyType<String> LOWERCASE_STRING
public PrimitivePropertyType(Function<Object,T> convertFunction)
convertFunction - function to convert to the given typepublic T convert(Object object)
PropertyTypeconvert in interface PropertyType<T>object - the object to convertpublic Object toExportValue(T value)
PropertyTypePropertyType.convert(java.lang.Object).)toExportValue in interface PropertyType<T>value - the value to convertCopyright © 2016–2019 The AuthMe Team. All rights reserved.