T - the array type the converter producespublic class StandardInlineArrayConverters<T> extends Object implements InlineArrayConverter<T>
InlineArrayConverter.| Modifier and Type | Field and Description |
|---|---|
static InlineArrayConverter<Boolean> |
BOOLEAN |
static InlineArrayConverter<Byte> |
BYTE |
static InlineArrayConverter<Double> |
DOUBLE |
static InlineArrayConverter<Float> |
FLOAT |
static InlineArrayConverter<Integer> |
INTEGER |
static InlineArrayConverter<Long> |
LONG |
static InlineArrayConverter<Short> |
SHORT |
static InlineArrayConverter<String> |
STRING |
| Constructor and Description |
|---|
StandardInlineArrayConverters(String separator,
IntFunction<T[]> arrayProducer,
Function<String,T> convertFunction) |
StandardInlineArrayConverters(String separator,
IntFunction<T[]> arrayProducer,
Function<String,T> convertFunction,
boolean useTrimAndSpaces)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected T |
convert(String input)
Converts from the given String to the converter's type, if possible.
|
T[] |
fromString(String input)
Converts from the String to an array of the converter's type.
|
String |
toExportValue(T[] value)
Converts the provided array to its String representation (opposite of
InlineArrayConverter.fromString(String)). |
public static final InlineArrayConverter<Long> LONG
public static final InlineArrayConverter<Integer> INTEGER
public static final InlineArrayConverter<Float> FLOAT
public static final InlineArrayConverter<Double> DOUBLE
public static final InlineArrayConverter<Short> SHORT
public static final InlineArrayConverter<Byte> BYTE
public static final InlineArrayConverter<Boolean> BOOLEAN
public static final InlineArrayConverter<String> STRING
public StandardInlineArrayConverters(String separator, IntFunction<T[]> arrayProducer, Function<String,T> convertFunction)
public StandardInlineArrayConverters(String separator, IntFunction<T[]> arrayProducer, Function<String,T> convertFunction, boolean useTrimAndSpaces)
separator - sequence by which the elements of the array are separated in the String representationarrayProducer - array constructor (desired array size as argument)convertFunction - convert function from String to type for one elementuseTrimAndSpaces - true if a space should be put after the separator in the export and if the split elements
from the input String should be trimmed before being passed to the convert functionpublic T[] fromString(String input)
InlineArrayConverterfromString in interface InlineArrayConverter<T>input - the string to convert frompublic String toExportValue(T[] value)
InlineArrayConverterInlineArrayConverter.fromString(String)).toExportValue in interface InlineArrayConverter<T>value - the value to convertCopyright © 2016–2019 The AuthMe Team. All rights reserved.