- java.lang.Object
-
- org.praxislive.core.Value
-
- Direct Known Subclasses:
ArgumentInfo,ComponentAddress,ComponentInfo,ComponentType,ControlAddress,ControlInfo,PArray,PBoolean,PBytes,PError,PMap,PNumber,PortAddress,PortInfo,PReference,PResource,PString
public abstract class Value extends Object
Abstract base class of all types used in messaging inside Praxis CORE. All Value sub-types are guaranteed to be immutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValue.Type<T extends Value>
-
Constructor Summary
Constructors Constructor Description Value()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanequals(Object obj)Values must override the default equals method.booleanequivalent(Value value)abstract inthashCode()Values must override the default hashcode method.static ArgumentInfoinfo()Use this method to return an ArgumentInfo argument that can be used to refer to ANY Value subclass.booleanisEmpty()Check whether this Value is an empty value and has a zero length string representation.abstract StringtoString()Values must override the default method to return a string representation that is immutable.Value.Type<?>type()
-
-
-
Method Detail
-
toString
public abstract String toString()
Values must override the default method to return a string representation that is immutable.
-
hashCode
public abstract int hashCode()
Values must override the default hashcode method.
-
equals
public abstract boolean equals(Object obj)
Values must override the default equals method. This method should only returntrueif the supplied Object is of the same type as the implementing Value. Values of an unknown type should be coerced before calling this method. This method does not have to guarantee thatthis.equals(that) == this.toString().equals(that.toString())
-
isEmpty
public boolean isEmpty()
Check whether this Value is an empty value and has a zero length string representation. Subclasses may wish to override this for efficiency if the String representation is lazily created.- Returns:
- boolean true if empty
-
equivalent
public boolean equivalent(Value value)
-
type
public Value.Type<?> type()
-
info
public static ArgumentInfo info()
Use this method to return an ArgumentInfo argument that can be used to refer to ANY Value subclass. Usually, you will want to get an ArgumentInfo object directly from a specific Value subclass.- Returns:
- ArgumentInfo info
-
-