K - the type of the keys in the mappublic class SimpleConstrainedMap<K> extends MutableConstrainedMap<K>
| Modifier and Type | Field and Description |
|---|---|
protected Map<K,IConstraint<?>> |
constraints |
protected IConstraint<?> |
fallback |
values| Modifier | Constructor and Description |
|---|---|
|
SimpleConstrainedMap() |
|
SimpleConstrainedMap(IConstraint<?> fallback) |
|
SimpleConstrainedMap(Map<K,IConstraint<?>> constraints,
IConstraint<?> fallback) |
protected |
SimpleConstrainedMap(Map<K,IConstraint<?>> constraints,
IConstraint<?> fallback,
Map<K,Object> values) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addConstraint(K key,
IConstraint<?> constraint) |
IMutableConstrainedMap<K> |
emptyWithSameConstraints()
|
IConstraint<?> |
getConstraint(K key)
|
protected IConstraint<?> |
getSuggestedConstraint(K key)
This method will only be called for keys for which
MutableConstrainedMap.getConstraint(Object) currently
returns null for. |
IMutableConstrainedMap<K> |
mutableCopy()
|
get, getPersistableString, keySet, put, put, putPersistedString, putPersistedStringprotected final Map<K,IConstraint<?>> constraints
protected final IConstraint<?> fallback
public SimpleConstrainedMap()
public SimpleConstrainedMap(IConstraint<?> fallback)
public SimpleConstrainedMap(Map<K,IConstraint<?>> constraints, IConstraint<?> fallback)
protected SimpleConstrainedMap(Map<K,IConstraint<?>> constraints, IConstraint<?> fallback, Map<K,Object> values)
public IConstraint<?> getConstraint(K key)
IConstrainedMapgetConstraint in interface IConstrainedMap<K>getConstraint in class MutableConstrainedMap<K>nullprotected IConstraint<?> getSuggestedConstraint(K key)
MutableConstrainedMapMutableConstrainedMap.getConstraint(Object) currently
returns null for. Thus, it doesn't matter, and is unspecified, what it would return for keys
which MutableConstrainedMap.getConstraint(Object) return non-null for, which typically simplifies the
implementations.getSuggestedConstraint in class MutableConstrainedMap<K>protected void addConstraint(K key, IConstraint<?> constraint)
addConstraint in class MutableConstrainedMap<K>public IMutableConstrainedMap<K> emptyWithSameConstraints()
IConstrainedMapmutable map, with the same initial constraints
as this map. It might be possible to add constraints to the created map, depending on the restrictions built into this map.public IMutableConstrainedMap<K> mutableCopy()
IConstrainedMapmutable copy of this map,
containing the same initial values as this map. It might be possible to add
constraints to the copy, depending on the restrictions built into this
map.Copyright © 2019. All rights reserved.