Cloneable, Sequenceablepublic class PersistablePacMap extends BasePacMap
BasePacMap class and permanently stores data using the JSON string representation.BasePacMapSequenceable.Producer<T>dataMap| 构造器 | 说明 |
|---|---|
PersistablePacMap() |
A constructor used to create an empty
PersistablePacMap instance. |
PersistablePacMap(int capacity) |
A constructor used to create an empty
PersistablePacMap instance
that contains capacity key-value pairs. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
PersistablePacMap |
deepCopy() |
Creates a deep copy of the
PersistablePacMap object. |
static PersistablePacMap |
fromJsonString(String jsonString) |
Creates a
PersistablePacMap object based on a given JSON string. |
boolean[] |
getBooleanValueArray(String key) |
Overrides the
BasePacMap#getBooleanValueArray method to obtain the boolean array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray. |
double |
getDoubleValue(String key) |
Overrides the
BasePacMap#getDoubleValue method to obtain the double value
in the unmarshalled PersistablePacMap object where double has been converted
into BigDecimal. |
double[] |
getDoubleValueArray(String key) |
Overrides the
BasePacMap#getDoubleValueArray method to obtain the double array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray. |
float |
getFloatValue(String key) |
Overrides the
BasePacMap#getFloatValue method to obtain the float value
in the unmarshalled PersistablePacMap object where float has been converted
into BigDecimal. |
float[] |
getFloatValueArray(String key) |
Overrides the
BasePacMap#getFloatValueArray method to obtain the float array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray. |
int[] |
getIntValueArray(String key) |
Overrides the
BasePacMap#getIntValueArray method to obtain the int array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray. |
long |
getLongValue(String key) |
Overrides the
BasePacMap#getLongValue method to obtain the long value
in the unmarshalled PersistablePacMap object where long has been converted
into Integer. |
long[] |
getLongValueArray(String key) |
Overrides the
BasePacMap#getLongValueArray method to obtain the long array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray. |
PersistablePacMap |
getPersistablePacMap(String key) |
Obtains the
PersistablePacMap object with the specified key. |
short |
getShortValue(String key) |
Overrides the
BasePacMap#getShortValue method to obtain the short value
in the unmarshalled PersistablePacMap object
where short has been converted into Integer. |
short[] |
getShortValueArray(String key) |
Overrides the
BasePacMap#getShortValueArray method to obtain the short array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray. |
static boolean |
isValidValueType(Object value) |
Checks whether the type of the
value object supports marshalling to
and unmarshalling from a JSON string. |
void |
putPersistablePacMap(String key,
PersistablePacMap value) |
Adds a
PersistablePacMap object with the specified key
into this PersistablePacMap object. |
String |
toJsonString() |
Obtains the JSON string representation of the
PersistablePacMap object. |
clear, clone, equals, getAll, getBooleanValue, getBooleanValue, getByteValue, getByteValue, getByteValueArray, getChar, getChar, getCharArray, getClassLoader, getDimension, getDoubleValue, getFloatDimension, getFloatValue, getIntValue, getIntValue, getKeys, getLongValue, getObjectValue, getObjectValue, getPlainArray, getRemoteObject, getShortValue, getSize, getString, getString, getStringArray, hasFileDescriptor, hashCode, hasKey, isEmpty, marshalling, putAll, putAll, putBooleanValue, putBooleanValueArray, putByteValue, putByteValueArray, putChar, putCharArray, putDimension, putDoubleValue, putDoubleValueArray, putFloatDimension, putFloatValue, putFloatValueArray, putIntValue, putIntValueArray, putLongValue, putLongValueArray, putObjectValue, putPlainArray, putRemoteObject, putShortValue, putShortValueArray, putString, putStringArray, remove, setClassLoader, unmarshallingpublic PersistablePacMap()
PersistablePacMap instance.public PersistablePacMap(int capacity)
PersistablePacMap instance
that contains capacity key-value pairs.capacity - Indicates the number of key-value pairs in the PersistablePacMap instance.public PersistablePacMap deepCopy()
PersistablePacMap object.
A deep copy is performed to create an object with the same content as the original one.
PersistablePacMap object.public static boolean isValidValueType(Object value)
value object supports marshalling to
and unmarshalling from a JSON string.value - Indicates the object to check.true if the value object supports marshalling
and unmarshalling; returns false otherwise.public void putPersistablePacMap(String key, PersistablePacMap value)
PersistablePacMap object with the specified key
into this PersistablePacMap object.
If the specified key already exists, its value will be replaced by value.
key - Indicates the key of the object to add.getPersistablePacMap(String key)public PersistablePacMap getPersistablePacMap(String key)
PersistablePacMap object with the specified key.key - Indicates the key used to query the object. The value can be null.PersistablePacMap object matching the specified key;
returns null if the matched value is not a PersistablePacMap object
or no value is obtained.putPersistablePacMap(String key, PersistablePacMap value)public short getShortValue(String key)
BasePacMap#getShortValue method to obtain the short value
in the unmarshalled PersistablePacMap object
where short has been converted into Integer.getShortValue 在类中 BasePacMapkey - Indicates the key of the short value to obtain.short value matching the specified key.BasePacMap.getShortValue(String)public long getLongValue(String key)
BasePacMap#getLongValue method to obtain the long value
in the unmarshalled PersistablePacMap object where long has been converted
into Integer.getLongValue 在类中 BasePacMapkey - Indicates the key of the long value to obtain.long value matching the specified key.BasePacMap.getLongValue(String)public double getDoubleValue(String key)
BasePacMap#getDoubleValue method to obtain the double value
in the unmarshalled PersistablePacMap object where double has been converted
into BigDecimal.getDoubleValue 在类中 BasePacMapkey - Indicates the key of the double value to obtain.double value matching the specified key.BasePacMap.getDoubleValue(String)public float getFloatValue(String key)
BasePacMap#getFloatValue method to obtain the float value
in the unmarshalled PersistablePacMap object where float has been converted
into BigDecimal.getFloatValue 在类中 BasePacMapkey - Indicates the key of the float value to obtain.float value matching the specified key.BasePacMap.getFloatValue(String)public int[] getIntValueArray(String key)
BasePacMap#getIntValueArray method to obtain the int array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray.getIntValueArray 在类中 BasePacMapkey - Indicates the key of the int array to obtain.int array matching the specified key.BasePacMap.getIntValueArray(String)public short[] getShortValueArray(String key)
BasePacMap#getShortValueArray method to obtain the short array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray.getShortValueArray 在类中 BasePacMapkey - Indicates the key of the short array to obtain.short array matching the specified key.BasePacMap.getShortValueArray(String)public long[] getLongValueArray(String key)
BasePacMap#getLongValueArray method to obtain the long array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray.getLongValueArray 在类中 BasePacMapkey - Indicates the key of the long array to obtain.long array matching the specified key.BasePacMap.getLongValueArray(String)public boolean[] getBooleanValueArray(String key)
BasePacMap#getBooleanValueArray method to obtain the boolean array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray.getBooleanValueArray 在类中 BasePacMapkey - Indicates the key of the boolean array to obtain.boolean array matching the specified key;
returns null if the JsonArray value in the unmarshalled
PersistablePacMap object cannot be converted to a boolean array.BasePacMap.getBooleanValueArray(String)public double[] getDoubleValueArray(String key)
BasePacMap#getDoubleValueArray method to obtain the double array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray.getDoubleValueArray 在类中 BasePacMapkey - Indicates the key of the double array to obtain.double array matching the specified key.BasePacMap.getDoubleValueArray(String)public float[] getFloatValueArray(String key)
BasePacMap#getFloatValueArray method to obtain the float array
in the unmarshalled PersistablePacMap object where an array has been converted
into JsonArray.getFloatValueArray 在类中 BasePacMapkey - Indicates the key of the float array to obtain.float array matching the specified key.BasePacMap.getFloatValueArray(String)public static PersistablePacMap fromJsonString(String jsonString)
PersistablePacMap object based on a given JSON string.jsonString - Indicates the JSON string used to create the PersistablePacMap object.PersistablePacMap object; returns null if the JSON string is invalid.toJsonString()public String toJsonString()
PersistablePacMap object.
This JSON string can be written into a file for persistent data storage.PersistablePacMap object.fromJsonString(java.lang.String)