Package org.pkl.core

Class PClassInfo<T>

  • All Implemented Interfaces:
    java.io.Serializable

    public final class PClassInfo<T>
    extends java.lang.Object
    implements java.io.Serializable
    Information about a Pkl class and its Java representation.
    See Also:
    Serialized Form
    • Method Detail

      • get

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

        public static PClassInfo<?> forModuleClass​(java.lang.String moduleName,
                                                   java.net.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 java.lang.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 java.lang.String getSimpleName()
        Returns the simple name of this Pkl class.
      • getQualifiedName

        public java.lang.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 java.lang.String getDisplayName()
      • isModuleClass

        public boolean isModuleClass()
      • getJavaClass

        public java.lang.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​(java.lang.Object value)
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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

        public java.net.URI getModuleUri()