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 Details

    • enumClass

      Object enumClass(Object enumValue)
      Recognizes an enum object. If the enumValue object represents an enum, then an object that represents its class shall be returned.
      Parameters:
      enumValue - the value to test
      Returns:
      null if the value isn't enum, otherwise its class
    • enumOrdinal

      int enumOrdinal(Object obj)
      Ordinal of an enum. If the obj represents an enum, then return its ordinal number otherwise return -1
      Parameters:
      obj - the value to test
      Returns:
      -1 if the obj isn't enum, otherwise its ordinal number
    • enumTypeValues

      String[] enumTypeValues(Object maybeEnumClass)
      All possible values of an enum. If the provided maybeEnumClass object represents an enum, then compute enum value names in ordinal order and return them as a string array. Otherwise return null
      Parameters:
      maybeEnumClass - the class to test
      Returns:
      null if the clazz isn't an enum, otherwise names of its values
    • typeName

      String typeName(Object maybeClass)
      Finds Java type name for a given class.
      Parameters:
      maybeClass - object representing the class
      Returns:
      the type name of the class or null if the parameter doesn't represent a class