Package org.pkl.core

Class PObject

  • All Implemented Interfaces:
    java.io.Serializable, Composite, Value
    Direct Known Subclasses:
    PModule

    public class PObject
    extends java.lang.Object
    implements Composite
    Java representation of a Pkl object.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected PClassInfo<?> classInfo  
      protected java.util.Map<java.lang.String,​java.lang.Object> properties  
    • Constructor Summary

      Constructors 
      Constructor Description
      PObject​(PClassInfo<?> classInfo, java.util.Map<java.lang.String,​java.lang.Object> properties)  
    • Field Detail

      • classInfo

        protected final PClassInfo<?> classInfo
      • properties

        protected final java.util.Map<java.lang.String,​java.lang.Object> properties
    • Constructor Detail

      • PObject

        public PObject​(PClassInfo<?> classInfo,
                       java.util.Map<java.lang.String,​java.lang.Object> properties)
    • Method Detail

      • getClassInfo

        public final PClassInfo<?> getClassInfo()
        Description copied from interface: Value
        Returns information about the Pkl class associated with this Value.
        Specified by:
        getClassInfo in interface Value
      • getProperties

        public final java.util.Map<java.lang.String,​java.lang.Object> getProperties()
        Description copied from interface: Composite
        Returns the properties of this composite.
        Specified by:
        getProperties in interface Composite
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
        Description copied from interface: Composite
        Returns the value of the property with the given name, or throws NoSuchPropertyException if no such property exists.
        Specified by:
        getProperty in interface Composite
      • accept

        public void accept​(ValueVisitor visitor)
        Description copied from interface: Value
        Invokes the given visitor's visit method for this Value.
        Specified by:
        accept in interface Value
      • accept

        public <T> T accept​(ValueConverter<T> converter)
        Description copied from interface: Value
        Invokes the given converters's convert method for this Value.
        Specified by:
        accept in interface 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
      • render

        protected java.lang.String render​(@Nullable java.lang.String prefix)