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
A mutable extension to
IConstrainedMap
. 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
Modifier and TypeMethodDescriptionvoid
Mapkey
tovalue
, if allowed according to either an existingconstraint
or an implicit default constraint, if available.<T> void
put
(K key, IConstraint<T> constraint, T value) Mapkey
tovalue
, if allowed according toconstraint
and additional restrictions on this map such as a conflictingconstraint
being in effect for thiskey
.void
putPersistedString
(K key, String persisted) Mapkey
to the value obtained by parsingpersisted
, if allowed according to either an existingconstraint
or an implicit default constraint, if available.<T> void
putPersistedString
(K key, IConstraint<T> constraint, String persisted) Mapkey
to the value obtained by parsingpersisted
, if allowed according toconstraint
and additional restrictions on this map such as a conflictingconstraint
being in effect for thiskey
.Methods inherited from interface org.openjdk.jmc.common.unit.IConstrainedMap
emptyWithSameConstraints, get, getConstraint, getPersistableString, keySet, mutableCopy
-
Method Details
-
put
Mapkey
tovalue
, if allowed according to either an existingconstraint
or an implicit default constraint, if available.- Throws:
ClassCastException
- if the actual type ofvalue
prevents it from being acceptedIllegalArgumentException
- if some restriction built into this map prevents values to be added forkey
, or possibly if some type aspect ofvalue
prevents it from being acceptedQuantityConversionException
- ifvalue
is rejected by the constraint in some other way
-
putPersistedString
Mapkey
to the value obtained by parsingpersisted
, if allowed according to either an existingconstraint
or an implicit default constraint, if available.- Throws:
IllegalArgumentException
- if some restriction built into this map prevents values to be added forkey
QuantityConversionException
- ifpersisted
is rejected by the constraint in some way
-
put
Mapkey
tovalue
, if allowed according toconstraint
and additional restrictions on this map such as a conflictingconstraint
being in effect for thiskey
.- Throws:
IllegalArgumentException
- if some restriction built into this map prevents values to be added forkey
, or a differentconstraint
being in effect forkey
, or possibly if some type aspect ofvalue
prevents it from being acceptedQuantityConversionException
- ifvalue
is rejected by the constraint in some other way
-
putPersistedString
<T> void putPersistedString(K key, IConstraint<T> constraint, String persisted) throws QuantityConversionException Mapkey
to the value obtained by parsingpersisted
, if allowed according toconstraint
and additional restrictions on this map such as a conflictingconstraint
being in effect for thiskey
.- Throws:
IllegalArgumentException
- if some restriction built into this map prevents values to be added forkey
, or a differentconstraint
being in effect forkey
QuantityConversionException
- ifpersisted
is rejected by the constraint in some other way
-