Interface Primitive

All Superinterfaces:
ApiHolder, MirrorBacked<PrimitiveType>, Shadow<PrimitiveType>
All Known Implementing Classes:
PrimitiveImpl

public interface Primitive extends Shadow<PrimitiveType>
represents primitive types, but not there wrapper classes. for example int, long, short
  • 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
    • asBoxed

      Class asBoxed()
      int -> Integer
      long -> Long etc...
    • asArray

      Array asArray()
      int -> int[]
    • equals

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