Enum Class PartitionParser
- All Implemented Interfaces:
Serializable
,Comparable<PartitionParser>
,java.lang.constant.Constable
Re-usable parsers for partition values encountered as
strings
, e.g. when inferring/assigning partition
values from elements in a path.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Comparable<?>>
static @Nullable PartitionParser
Look up the PartitionParser fortype
.static @Nullable PartitionParser
Look up the PartitionParser fordataType
andcomponentType
.static @NotNull PartitionParser
lookupSupported
(@NotNull Type<?> type) Look up the PartitionParser fortype
.static @NotNull PartitionParser
lookupSupported
(@NotNull Class<?> dataType, @Nullable Class<?> componentType) Look up the PartitionParser fordataType
andcomponentType
.Comparable<?>
ParsestringValue
to the expected type, boxed as anObject
if primitive.static PartitionParser
Returns the enum constant of this class with the specified name.static PartitionParser[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ForString
-
ForBoolean
-
ForChar
-
ForByte
-
ForShort
-
ForInt
-
ForLong
-
ForFloat
-
ForDouble
-
ForBigInteger
-
ForBigDecimal
-
ForInstant
-
ForLocalDate
-
ForLocalTime
-
ForZonedDateTime
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getResultType
- Returns:
- The result type
-
parse
ParsestringValue
to the expected type, boxed as anObject
if primitive.Empty
inputs are always parsed tonull
. No other pre-parsing adjustments, e.g.trim
, are performed onstringValue
before applying type-specific parsing logic.- Parameters:
stringValue
- TheString
to parse- Returns:
- The parsed result partition value as an
Object
- Throws:
NullPointerException
- ifstringValue
isnull
IllegalArgumentException
- ifstringValue
could not be parsed
-
lookup
@Nullable public static @Nullable PartitionParser lookup(@NotNull @NotNull Class<?> dataType, @Nullable @Nullable Class<?> componentType) Look up the PartitionParser fordataType
andcomponentType
. -
lookupSupported
@NotNull public static @NotNull PartitionParser lookupSupported(@NotNull @NotNull Class<?> dataType, @Nullable @Nullable Class<?> componentType) Look up the PartitionParser fordataType
andcomponentType
.- Parameters:
dataType
- The data typeClass
to look upcomponentType
- The component typeClass
to look up, ornull
if there is none- Returns:
- The appropriate PartitionParser
- Throws:
IllegalArgumentException
- for unsupporteddataType
values
-
lookup
Look up the PartitionParser fortype
.- Parameters:
type
- TheType
to look up- Returns:
- The appropriate PartitionParser, or
null
for unsupportedtype
values
-
lookupSupported
Look up the PartitionParser fortype
.- Parameters:
type
- TheType
to look up- Returns:
- The appropriate PartitionParser, or
null
for unsupportedtype
values
-