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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Converter<?,
?> createEnumArrayConverter
(Class<? extends Enum<?>> enumType, int dimensions) Create aConverter
for arrays based on converting the base elements with anEnumConverter
.static EnumConverter<?>
createEnumConverter
(Class<? extends Enum<?>> enumType) Convenience "constructor" allowing wildcard callerEnum
types.protected T
doBackward
(EnumValue enumValue) protected EnumValue
boolean
Get theEnum
type associated with this instance.int
hashCode()
toString()
Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, from, identity, reverse
-
Constructor Details
-
EnumConverter
Constructor.- Parameters:
enumType
-Enum
type- Throws:
IllegalArgumentException
- ifenumType
is null
-
-
Method Details
-
doForward
-
doBackward
-
getEnumType
Get theEnum
type associated with this instance.- Returns:
- associated
Enum
type
-
createEnumConverter
Convenience "constructor" allowing wildcard callerEnum
types.- Parameters:
enumType
- type for the created converter- Returns:
- new converter
-
createEnumArrayConverter
public static Converter<?,?> createEnumArrayConverter(Class<? extends Enum<?>> enumType, int dimensions) Create aConverter
for arrays based on converting the base elements with anEnumConverter
.- Parameters:
enumType
- base enum typedimensions
- number of array dimensions- Returns:
- new converter
- Throws:
IllegalArgumentException
- ifenumType
is nullIllegalArgumentException
- ifdimemsions
is not between 1 and 255 (inclusive)
-
equals
-
hashCode
public int hashCode() -
toString
-