Class ConfigType<T>

java.lang.Object
redempt.redlib.config.ConfigType<T>
Type Parameters:
T - The base type

public class ConfigType<T> extends Object
Represents a type and its type parameters
  • Constructor Details

    • ConfigType

      public ConfigType(Class<T> clazz, List<ConfigType<?>> componentTypes)
      Constructs a ConfigType from a base class type and a list of component ConfigTypes
      Parameters:
      clazz - The base class type
      componentTypes - The component types
    • ConfigType

      public ConfigType(Class<T> clazz)
      Constructs a ConfigType with no component types
      Parameters:
      clazz - The class type
  • Method Details

    • create

      public static ConfigType<?> create(Type type)
      Creates a ConfigType from an arbitrary Type
      Parameters:
      type - The Type
      Returns:
      A ConfigType representation of the Type
    • get

      public static ConfigType<?> get(Field field)
      Gets the ConfigType of a specific Field
      Parameters:
      field - The field
      Returns:
      A ConfigType for the field
    • getType

      public Class<T> getType()
      Returns:
      The base type of this ConfigType
    • getComponentTypes

      public List<ConfigType<?>> getComponentTypes()
      Returns:
      A list of all component types of this ConfigType
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object