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 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 Detail

      • put

        void put​(K key,
                 java.lang.Object value)
          throws QuantityConversionException
        Map key to value, if allowed according to either an existing constraint or an implicit default constraint, if available.
        Throws:
        java.lang.ClassCastException - if the actual type of value prevents it from being accepted
        java.lang.IllegalArgumentException - if some restriction built into this map prevents values to be added for key, or possibly if some type aspect of value prevents it from being accepted
        QuantityConversionException - if value is rejected by the constraint in some other way
      • putPersistedString

        void putPersistedString​(K key,
                                java.lang.String persisted)
                         throws QuantityConversionException
        Map key to the value obtained by parsing persisted, if allowed according to either an existing constraint or an implicit default constraint, if available.
        Throws:
        java.lang.IllegalArgumentException - if some restriction built into this map prevents values to be added for key
        QuantityConversionException - if persisted is rejected by the constraint in some way
      • put

        <T> void put​(K key,
                     IConstraint<T> constraint,
                     T value)
              throws QuantityConversionException
        Map key to value, if allowed according to constraint and additional restrictions on this map such as a conflicting constraint being in effect for this key.
        Throws:
        java.lang.IllegalArgumentException - if some restriction built into this map prevents values to be added for key, or a different constraint being in effect for key, or possibly if some type aspect of value prevents it from being accepted
        QuantityConversionException - if value is rejected by the constraint in some other way
      • putPersistedString

        <T> void putPersistedString​(K key,
                                    IConstraint<T> constraint,
                                    java.lang.String persisted)
                             throws QuantityConversionException
        Map key to the value obtained by parsing persisted, if allowed according to constraint and additional restrictions on this map such as a conflicting constraint being in effect for this key.
        Throws:
        java.lang.IllegalArgumentException - if some restriction built into this map prevents values to be added for key, or a different constraint being in effect for key
        QuantityConversionException - if persisted is rejected by the constraint in some other way