Interface RecordComponent

All Superinterfaces:
Annotationable<RecordComponentElement>, ApiHolder, ElementBacked<RecordComponentElement>, MirrorBacked<TypeMirror>, Modifiable, Shadow<TypeMirror>
All Known Implementing Classes:
RecordComponentImpl

public interface RecordComponent extends Shadow<TypeMirror>, Annotationable<RecordComponentElement>
  • Method Details

    • isSubtypeOf

      boolean isSubtypeOf(Shadow<? extends TypeMirror> shadow)
      returns true if this can be cast to that. This can be useful if you want to check if a shadow implements for example a Collection shadowToTest.erasure().isSubtypeOf(shadowApi.getDeclaredOrThrow("java.util.Collection").erasure())
    • isAssignableFrom

      boolean isAssignableFrom(Shadow<? extends TypeMirror> shadow)
      Equivalent to isSubtypeOf(Shadow) except for primitives. if one is a primitive and the other is not it tries to convert them
    • getRecord

      Record getRecord()
      returns the record this is a port of
    • getType

      Shadow<TypeMirror> getType()
    • getGetter

      Method getGetter()
    • getPackage

      Package getPackage()
    • erasure

      RecordComponent erasure()
      Information regarding generics is lost after the compilation. For Example List<String> becomes List. This method Does the same. This can be useful if you want to check if a shadow implements for example Collection shadowToTest.erasure().isSubtypeOf(shadowApi.getDeclaredOrThrow("java.util.Collection").erasure())

      for RecordComponents this means for example record MyRecord<T>(T t){} -> record MyRecord<T>(java.lang.Object t){}

    • equals

      boolean equals(Object obj)
      be careful using this equals
      Specified by:
      equals in interface Shadow<TypeMirror>
      Overrides:
      equals in class Object
      See Also: