Interface GraphTypes
public interface GraphTypes
Special support for dealing with enums. Normally one can represent various
graph enum values with real Enum instances. In case this is not possible, the
GraphOutput.Builder allows one to register
an implementation of this interface to treat them specially.-
Method Summary
Modifier and TypeMethodDescriptionRecognizes anenum
object.intenumOrdinal(Object obj) Ordinal of an enum.String[]enumTypeValues(Object maybeEnumClass) All possible values of an enum.Finds Java type name for a given class.
-
Method Details
-
enumClass
-
enumOrdinal
Ordinal of an enum. If theobjrepresents an enum, then return its ordinal number otherwise return-1- Parameters:
obj- the value to test- Returns:
-1if the obj isn't enum, otherwise its ordinal number
-
enumTypeValues
All possible values of an enum. If the providedmaybeEnumClassobject represents an enum, then compute enum value names in ordinal order and return them as a string array. Otherwise returnnull- Parameters:
maybeEnumClass- the class to test- Returns:
nullif the clazz isn't an enum, otherwise names of its values
-
typeName
-