Package foundry.veil.api.util
Class EnumCodec.Builder<T extends Enum<?>>
java.lang.Object
foundry.veil.api.util.EnumCodec.Builder<T>
- Type Parameters:
T
- The enum type to encode/decode
Builder for creating a new
EnumCodec
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Specifies the standard names to be lowercase.toStringFunction
(Function<T, String> toString) Specifies what function to use when getting the name of an enum constant.Specifies the standard names to be uppercase.Sets the valid values of this codec to all the enum constants provided by the specified class.final EnumCodec.Builder
<T> Sets the valid values of this codec to the specified values.
-
Constructor Details
-
Builder
-
-
Method Details
-
values
Sets the valid values of this codec to all the enum constants provided by the specified class.- Parameters:
clazz
- The class to get the constants of
-
values
Sets the valid values of this codec to the specified values.- Parameters:
values
- The values to use
-
toStringFunction
Specifies what function to use when getting the name of an enum constant.- Parameters:
toString
- The new function
-
uppercase
Specifies the standard names to be uppercase. -
lowercase
Specifies the standard names to be lowercase. -
build
- Returns:
- A new enum codec
-