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, putPersistedString
protected 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)
IConstrainedMap
getConstraint
in interface IConstrainedMap<K>
getConstraint
in class MutableConstrainedMap<K>
null
protected IConstraint<?> getSuggestedConstraint(K key)
MutableConstrainedMap
MutableConstrainedMap.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()
IConstrainedMap
mutable
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()
IConstrainedMap
mutable
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 © 2020. All rights reserved.