Record Class TypeUtils

java.lang.Object
java.lang.Record
org.geysermc.databaseutils.processor.util.TypeUtils

public record TypeUtils(Types typeUtils, Elements elementUtils) extends Record
  • Constructor Details

    • TypeUtils

      public TypeUtils(Types typeUtils, Elements elementUtils)
      Creates an instance of a TypeUtils record class.
      Parameters:
      typeUtils - the value for the typeUtils record component
      elementUtils - the value for the elementUtils record component
  • Method Details

    • elementFor

      public TypeElement elementFor(CharSequence name)
    • elementFor

      public TypeElement elementFor(Class<?> clazz)
    • toBoxedMirror

      public TypeMirror toBoxedMirror(TypeMirror mirror)
    • toBoxedTypeElement

      public TypeElement toBoxedTypeElement(TypeMirror mirror)
    • isAssignable

      public boolean isAssignable(TypeMirror impl, TypeMirror base)
    • isAssignable

      public boolean isAssignable(TypeMirror impl, CharSequence base)
    • isAssignable

      public boolean isAssignable(TypeMirror impl, Class<?> base)
    • canonicalName

      public CharSequence canonicalName(TypeMirror mirror)
    • collectionImplementationFor

      public com.squareup.javapoet.ClassName collectionImplementationFor(TypeMirror returnType)
    • isType

      public boolean isType(Class<?> clazz, TypeMirror mirror)
    • isType

      public boolean isType(CharSequence expected, TypeMirror actual)
    • isType

      public boolean isType(TypeMirror expected, TypeMirror actual)
    • isTypeExact

      public boolean isTypeExact(TypeMirror expected, TypeMirror actual)
      Compared to the normal isType methods this one doesn't erase and doesn't box the types
    • packageNameFor

      public static String packageNameFor(Name className)
    • packageNameFor

      public static String packageNameFor(String className)
    • needsTypeCodec

      public static boolean needsTypeCodec(Name className)
    • isWholeNumberType

      public boolean isWholeNumberType(TypeMirror mirror)
    • unboxType

      public TypeMirror unboxType(TypeMirror mirror)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • typeUtils

      public Types typeUtils()
      Returns the value of the typeUtils record component.
      Returns:
      the value of the typeUtils record component
    • elementUtils

      public Elements elementUtils()
      Returns the value of the elementUtils record component.
      Returns:
      the value of the elementUtils record component