java.lang.Object
xyz.janboerman.scalaloader.configurationserializable.runtime.ParameterType
Direct Known Subclasses:
ArrayParameterType, ParameterizedParameterType

public class ParameterType extends Object
Represents a plain type. When registering a Codec, this type should correspond to the LIVE type of a Codec
See Also:
  • Method Details

    • getRawType

      public Class<?> getRawType()
      Get the raw type
      Returns:
      the raw type
    • getAnnotations

      public Set<? extends Annotation> getAnnotations()
      Get the annotations present with this parameter type.
      Returns:
      the annotations
    • getAnnotation

      public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
      Get the annotation of a given annotation type.
      Type Parameters:
      A - the annotation type
      Parameters:
      annotationClass - the annotation type
      Returns:
      the annotation, or null if this type is not annotated with an annotation of the given annotation type
    • from

      public static ParameterType from(Set<? extends Annotation> annotations, Type type)
      Construct the ParameterType that includes annotation information.
      Parameters:
      annotations - the annotations
      type - the Class
      Returns:
      a new ParameterType
    • from

      public static ParameterType from(Type type)
      Construct a ParameterType from a Class.
      Parameters:
      type - the type in terms of Java's reflection api.
      Returns:
      a new ParameterType
    • from

      public static ParameterType from(Parameter parameter)
      Construct a ParameterType from a Parameter.
      Parameters:
      parameter - the type in terms of Java's reflection api.
      Returns:
      a new ParameterType
    • from

      public static ParameterType from(AnnotatedType type)
      Construct a ParameterType from an AnnotatedType
      Parameters:
      type - the type in terms of Java's reflection api.
      Returns:
      a new ParameterType
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object