Package org.pkl.core

Class PClassInfo<T>

java.lang.Object
org.pkl.core.PClassInfo<T>
All Implemented Interfaces:
Serializable

public final class PClassInfo<T> extends Object implements Serializable
Information about a Pkl class and its Java representation.
See Also:
  • Field Details

  • Method Details

    • get

      public static PClassInfo<?> get(String moduleName, String className, URI moduleUri)
      Returns the class info for the class with the given module and class name.
    • forModuleClass

      public static PClassInfo<?> forModuleClass(String moduleName, URI moduleUri)
      Returns the class info for the module class with the given module name.
    • forValue

      public static <T> PClassInfo<T> forValue(T value)
      Returns the class info for the given value's class.
    • getModuleName

      public String getModuleName()
      Returns the name of the module that this Pkl class is declared in. Note that a module name is not guaranteed to be unique, especially if it not declared but inferred.
    • getSimpleName

      public String getSimpleName()
      Returns the simple name of this Pkl class.
    • getQualifiedName

      public String getQualifiedName()
      Returns the qualified name of this Pkl class, `moduleName/className`. Note that a qualified class name is not guaranteed to be unique, especially if the module name is not declared but inferred.
    • getDisplayName

      public String getDisplayName()
    • isModuleClass

      public boolean isModuleClass()
    • getJavaClass

      public Class<T> getJavaClass()
      Returns the concrete Java class used to represent values of this Pkl class in Java. Returns Void.class for abstract Pkl classes.
    • isExternalClass

      public boolean isExternalClass()
      Tells if this Pkl class is external (built-in).
    • isStandardLibraryClass

      public boolean isStandardLibraryClass()
      Tells if this class is defined in Pkl's standard library.
    • isConcreteCollectionClass

      public boolean isConcreteCollectionClass()
    • isExactClassOf

      public boolean isExactClassOf(Object value)
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

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

      public URI getModuleUri()