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 ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Comparable<?>>static @Nullable PartitionParserLook up the PartitionParser fortype.static @Nullable PartitionParserLook up the PartitionParser fordataTypeandcomponentType.static @NotNull PartitionParserlookupSupported(@NotNull Type<?> type) Look up the PartitionParser fortype.static @NotNull PartitionParserlookupSupported(@NotNull Class<?> dataType, @Nullable Class<?> componentType) Look up the PartitionParser fordataTypeandcomponentType.Comparable<?>ParsestringValueto the expected type, boxed as anObjectif primitive.static PartitionParserReturns 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
ParsestringValueto the expected type, boxed as anObjectif primitive.Emptyinputs are always parsed tonull. No other pre-parsing adjustments, e.g.trim, are performed onstringValuebefore applying type-specific parsing logic.- Parameters:
stringValue- TheStringto parse- Returns:
- The parsed result partition value as an
Object - Throws:
NullPointerException- ifstringValueisnullIllegalArgumentException- ifstringValuecould not be parsed
-
lookup
@Nullable public static @Nullable PartitionParser lookup(@NotNull @NotNull Class<?> dataType, @Nullable @Nullable Class<?> componentType) Look up the PartitionParser fordataTypeandcomponentType. -
lookupSupported
@NotNull public static @NotNull PartitionParser lookupSupported(@NotNull @NotNull Class<?> dataType, @Nullable @Nullable Class<?> componentType) Look up the PartitionParser fordataTypeandcomponentType.- Parameters:
dataType- The data typeClassto look upcomponentType- The component typeClassto look up, ornullif there is none- Returns:
- The appropriate PartitionParser
- Throws:
IllegalArgumentException- for unsupporteddataTypevalues
-
lookup
Look up the PartitionParser fortype.- Parameters:
type- TheTypeto look up- Returns:
- The appropriate PartitionParser, or
nullfor unsupportedtypevalues
-
lookupSupported
Look up the PartitionParser fortype.- Parameters:
type- TheTypeto look up- Returns:
- The appropriate PartitionParser, or
nullfor unsupportedtypevalues
-