- java.lang.Object
-
- org.praxislive.core.Value
-
- org.praxislive.core.types.PMap
-
public final class PMap extends Value
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPMap.Builder-
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PMap.Builderbuilder()static PMap.Builderbuilder(int initialCapacity)booleanequals(Object obj)Values must override the default equals method.booleanequivalent(Value arg)static Optional<PMap>from(Value arg)Valueget(String key)booleangetBoolean(String key, boolean def)doublegetDouble(String key, double def)intgetInt(String key, int def)StringgetString(String key, String def)inthashCode()Values must override the default hashcode method.booleanisEmpty()Check whether this Value is an empty value and has a zero length string representation.List<String>keys()static PMapof(String key, Object value)static PMapof(String key1, Object value1, String key2, Object value2)static PMapof(String key1, Object value1, String key2, Object value2, String key3, Object value3)static PMapparse(String str)intsize()StringtoString()Values must override the default method to return a string representation that is immutable.
-
-
-
Field Detail
-
EMPTY
public static final PMap EMPTY
-
-
Method Detail
-
getBoolean
public boolean getBoolean(String key, boolean def)
-
getInt
public int getInt(String key, int def)
-
getDouble
public double getDouble(String key, double def)
-
size
public int size()
-
toString
public String toString()
Description copied from class:ValueValues must override the default method to return a string representation that is immutable.
-
isEmpty
public boolean isEmpty()
Description copied from class:ValueCheck 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.
-
equivalent
public boolean equivalent(Value arg)
- Overrides:
equivalentin classValue
-
hashCode
public int hashCode()
Description copied from class:ValueValues must override the default hashcode method.
-
equals
public boolean equals(Object obj)
Description copied from class:ValueValues 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())
-
of
public static PMap of(String key1, Object value1, String key2, Object value2, String key3, Object value3)
-
parse
public static PMap parse(String str) throws ValueFormatException
- Throws:
ValueFormatException
-
builder
public static PMap.Builder builder()
-
builder
public static PMap.Builder builder(int initialCapacity)
-
-