Package org.openjdk.jmc.common.unit
Interface IMutableConstrainedMap<K>
-
- Type Parameters:
K- the type of the keys in the map
- All Superinterfaces:
IConstrainedMap<K>
- All Known Implementing Classes:
MutableConstrainedMap,SimpleConstrainedMap
public interface IMutableConstrainedMap<K> extends IConstrainedMap<K>
A mutable extension toIConstrainedMap. Note that it is the values that can be mutated. Existing constraints cannot be modified. However, some implementations may allow adding constraints for keys that currently doesn't have a constraint, and thus no current value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidput(K key, Object value)Mapkeytovalue, if allowed according to either an existingconstraintor an implicit default constraint, if available.<T> voidput(K key, IConstraint<T> constraint, T value)Mapkeytovalue, if allowed according toconstraintand additional restrictions on this map such as a conflictingconstraintbeing in effect for thiskey.voidputPersistedString(K key, String persisted)Mapkeyto the value obtained by parsingpersisted, if allowed according to either an existingconstraintor an implicit default constraint, if available.<T> voidputPersistedString(K key, IConstraint<T> constraint, String persisted)Mapkeyto the value obtained by parsingpersisted, if allowed according toconstraintand additional restrictions on this map such as a conflictingconstraintbeing in effect for thiskey.-
Methods inherited from interface org.openjdk.jmc.common.unit.IConstrainedMap
emptyWithSameConstraints, get, getConstraint, getPersistableString, keySet, mutableCopy
-
-
-
-
Method Detail
-
put
void put(K key, Object value) throws QuantityConversionException
Mapkeytovalue, if allowed according to either an existingconstraintor an implicit default constraint, if available.- Throws:
ClassCastException- if the actual type ofvalueprevents it from being acceptedIllegalArgumentException- if some restriction built into this map prevents values to be added forkey, or possibly if some type aspect ofvalueprevents it from being acceptedQuantityConversionException- ifvalueis rejected by the constraint in some other way
-
putPersistedString
void putPersistedString(K key, String persisted) throws QuantityConversionException
Mapkeyto the value obtained by parsingpersisted, if allowed according to either an existingconstraintor an implicit default constraint, if available.- Throws:
IllegalArgumentException- if some restriction built into this map prevents values to be added forkeyQuantityConversionException- ifpersistedis rejected by the constraint in some way
-
put
<T> void put(K key, IConstraint<T> constraint, T value) throws QuantityConversionException
Mapkeytovalue, if allowed according toconstraintand additional restrictions on this map such as a conflictingconstraintbeing in effect for thiskey.- Throws:
IllegalArgumentException- if some restriction built into this map prevents values to be added forkey, or a differentconstraintbeing in effect forkey, or possibly if some type aspect ofvalueprevents it from being acceptedQuantityConversionException- ifvalueis rejected by the constraint in some other way
-
putPersistedString
<T> void putPersistedString(K key, IConstraint<T> constraint, String persisted) throws QuantityConversionException
Mapkeyto the value obtained by parsingpersisted, if allowed according toconstraintand additional restrictions on this map such as a conflictingconstraintbeing in effect for thiskey.- Throws:
IllegalArgumentException- if some restriction built into this map prevents values to be added forkey, or a differentconstraintbeing in effect forkeyQuantityConversionException- ifpersistedis rejected by the constraint in some other way
-
-