Package io.permazen
Class EnumConverter<T extends Enum<T>>
java.lang.Object
com.google.common.base.Converter<T,EnumValue>
io.permazen.EnumConverter<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Converter<?,?> createEnumArrayConverter(Class<? extends Enum<?>> enumType, int dimensions) Create aConverterfor arrays based on converting the base elements with anEnumConverter.static EnumConverter<?>createEnumConverter(Class<? extends Enum<?>> enumType) Convenience "constructor" allowing wildcard callerEnumtypes.protected TdoBackward(EnumValue enumValue) protected EnumValuebooleanGet theEnumtype associated with this instance.inthashCode()toString()Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, from, identity, reverse
-
Constructor Details
-
EnumConverter
Constructor.- Parameters:
enumType-Enumtype- Throws:
IllegalArgumentException- ifenumTypeis null
-
-
Method Details
-
doForward
-
doBackward
-
getEnumType
Get theEnumtype associated with this instance.- Returns:
- associated
Enumtype
-
createEnumConverter
Convenience "constructor" allowing wildcard callerEnumtypes.- Parameters:
enumType- type for the created converter- Returns:
- new converter
-
createEnumArrayConverter
public static Converter<?,?> createEnumArrayConverter(Class<? extends Enum<?>> enumType, int dimensions) Create aConverterfor arrays based on converting the base elements with anEnumConverter.- Parameters:
enumType- base enum typedimensions- number of array dimensions- Returns:
- new converter
- Throws:
IllegalArgumentException- ifenumTypeis nullIllegalArgumentException- ifdimemsionsis not between 1 and 255 (inclusive)
-
equals
-
hashCode
public int hashCode() -
toString
-