Package org.pkl.core
Class PObject
- java.lang.Object
-
- org.pkl.core.PObject
-
- 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<?>classInfoprotected 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(ValueConverter<T> converter)Invokes the given converters's convert method for thisValue.voidaccept(ValueVisitor visitor)Invokes the given visitor's visit method for thisValue.booleanequals(@Nullable java.lang.Object obj)PClassInfo<?>getClassInfo()Returns information about the Pkl class associated with thisValue.java.util.Map<java.lang.String,java.lang.Object>getProperties()Returns the properties of this composite.java.lang.ObjectgetProperty(java.lang.String name)Returns the value of the property with the given name, or throwsNoSuchPropertyExceptionif no such property exists.inthashCode()protected java.lang.Stringrender(@Nullable java.lang.String prefix)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pkl.core.Composite
get, getPropertyOrNull, hasProperty
-
-
-
-
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:ValueReturns information about the Pkl class associated with thisValue.- Specified by:
getClassInfoin interfaceValue
-
getProperties
public final java.util.Map<java.lang.String,java.lang.Object> getProperties()
Description copied from interface:CompositeReturns the properties of this composite.- Specified by:
getPropertiesin interfaceComposite
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Description copied from interface:CompositeReturns the value of the property with the given name, or throwsNoSuchPropertyExceptionif no such property exists.- Specified by:
getPropertyin interfaceComposite
-
accept
public void accept(ValueVisitor visitor)
Description copied from interface:ValueInvokes the given visitor's visit method for thisValue.
-
accept
public <T> T accept(ValueConverter<T> converter)
Description copied from interface:ValueInvokes the given converters's convert method for thisValue.
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
render
protected java.lang.String render(@Nullable java.lang.String prefix)
-
-