Class MutableConstrainedMap<K>

  • Type Parameters:
    K - the type of the keys in the map
    All Implemented Interfaces:
    IConstrainedMap<K>, IMutableConstrainedMap<K>
    Direct Known Subclasses:
    SimpleConstrainedMap

    public abstract class MutableConstrainedMap<K>
    extends java.lang.Object
    implements IMutableConstrainedMap<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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<K,​java.lang.Object> values  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addConstraint​(K key, IConstraint<?> constraint)  
      java.lang.Object get​(K key)
      Get the mapped value for key, or null if no value is currently mapped.
      abstract IConstraint<?> getConstraint​(K key)
      Get a constraint for mapped values of key, if a constraint has been imposed for key.
      java.lang.String getPersistableString​(K key)
      Get the persistable string of the mapped value for key, or null if no value is currently mapped.
      private <T> java.lang.String getPersistableString​(IConstraint<T> constraint, java.lang.Object value)  
      protected IConstraint<?> getSuggestedConstraint​(K key)
      This method will only be called for keys for which getConstraint(Object) currently returns null for.
      java.util.Set<K> keySet()  
      void put​(K key, java.lang.Object value)
      Map key to value, if allowed according to either an existing constraint or an implicit default constraint, if available.
      <T> void put​(K key, IConstraint<T> constraint, T value)
      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.
      void putPersistedString​(K key, java.lang.String persisted)
      Map key to the value obtained by parsing persisted, if allowed according to either an existing constraint or an implicit default constraint, if available.
      <T> void putPersistedString​(K key, IConstraint<T> constraint, java.lang.String persisted)
      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.
      private <T> void validate​(IConstraint<T> constraint, java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait