Package com.mayam.wf.attributes.shared
Class AttributeMultiMap
java.lang.Object
com.mayam.wf.attributes.shared.AttributeMultiMap
- All Implemented Interfaces:
Serializable
Map from
Attribute
to a set of values and a flag indicating
inclusive or exclusive use. When properly injected,
the map will validate input to make sure it conforms to
Attribute
annotations.- Author:
- Markus MÃ¥rtensson
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static interface
Describes a class containing anAttributeMultiMap
. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAsExclusion
(@NonNull Attribute attribute, @Nullable Object value) void
addAsExclusions
(@NonNull Attribute attribute, @NonNull Object... values) void
addAsExclusions
(@NonNull Attribute attribute, @NonNull Collection<?> values) void
addAsInclusion
(@NonNull Attribute attribute, @Nullable Object value) void
addAsInclusions
(@NonNull Attribute attribute, @NonNull Object... values) void
addAsInclusions
(@NonNull Attribute attribute, @NonNull Collection<?> values) void
clear()
Removes all values from the values.boolean
containsAttribute
(@NonNull Attribute attribute) @NonNull AttributeMultiMap
copy()
Creates a full copy of the values.@NonNull AttributeMultiMap
copy
(@NonNull Collection<Attribute> attributes) Creates a partial copy of the map, including only the provided collection of attributes.boolean
@Nullable AttributeMultiMap.Inclusivity
getAttributeInclusivity
(@NonNull Attribute attribute) <T> @Nullable Set
<T> getAttributeValues
(@NonNull Attribute attribute) <T> @Nullable Set
<T> getAttributeValues
(@NonNull Attribute attribute, @NonNull Class<T> cls) int
hashCode()
boolean
Checks for the existence ofAttributeValidator
helper instance.void
injectHelpers
(AttributeValidator validator) Injects helper objects.static @Nullable AttributeMultiMap
merge
(@Nullable AttributeMultiMap original, @Nullable AttributeMultiMap overrides) Merges two AttributeRangeMap objects with priority given to the one referred to as "overrides".void
putAll
(@NonNull AttributeMultiMap other) void
-
Field Details
-
validator
-
-
Constructor Details
-
AttributeMultiMap
public AttributeMultiMap()
-
-
Method Details
-
hasInjectedHelpers
public boolean hasInjectedHelpers()Checks for the existence ofAttributeValidator
helper instance.- Returns:
- true if the helper is injected.
-
hashCode
public int hashCode() -
equals
-
clear
public void clear()Removes all values from the values. -
getAttributeSet
-
copy
Creates a full copy of the values. Dirty values are included, but the resulting map will have no dirty flags set.- Returns:
- new values.
-
copy
Creates a partial copy of the map, including only the provided collection of attributes. Dirty values are included, but the resulting map will have no dirty flags set.- Returns:
- new values.