public interface Item<V extends PrismValue,D extends ItemDefinition> extends Itemable, DebugDumpable, Visitable, PathVisitable, ParentVisitable, Serializable, Revivable
This is supposed to be a superclass for all items. Items are things that can appear in containers, which generally means only a property, reference and container itself. Therefore this is in fact superclass for those three definitions.
INDENT_STRING
Modifier and Type | Method and Description |
---|---|
void |
acceptParentVisitor(Visitor visitor)
Accepts a visitor that visits each item/value on the way to the structure root.
|
boolean |
add(V newValue)
Adds a given value, unless an equivalent one is already there.
|
boolean |
add(V newValue,
boolean checkUniqueness)
Adds a given value, unless an equivalent one is already there (if checkUniqueness is true).
|
boolean |
add(V newValue,
EquivalenceStrategy equivalenceStrategy)
Adds a given value, unless an equivalent one is already there.
|
boolean |
addAll(Collection<V> newValues)
Adds given values, with the same semantics as repeated add(..) calls.
|
boolean |
addAll(Collection<V> newValues,
EquivalenceStrategy strategy)
Adds given values, with the same semantics as repeated add(..) calls.
|
void |
applyDefinition(D definition) |
void |
applyDefinition(D definition,
boolean force) |
void |
assertDefinitions() |
void |
assertDefinitions(boolean tolerateRawValues,
String sourceDescription) |
void |
assertDefinitions(String sourceDescription) |
void |
checkConsistence() |
void |
checkConsistence(boolean requireDefinitions,
boolean prohibitRaw) |
void |
checkConsistence(boolean requireDefinitions,
boolean prohibitRaw,
ConsistencyCheckScope scope) |
void |
checkConsistence(boolean requireDefinitions,
ConsistencyCheckScope scope) |
void |
checkConsistence(ConsistencyCheckScope scope) |
void |
checkConsistenceInternal(Itemable rootItem,
boolean requireDefinitions,
boolean prohibitRaw,
ConsistencyCheckScope scope) |
void |
checkImmutability() |
void |
clear()
Removes all values from the item.
|
Item |
clone()
Literal clone.
|
static <T extends Item> |
cloneCollection(Collection<T> items) |
Item |
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.
|
boolean |
contains(V value) |
boolean |
contains(V value,
EquivalenceStrategy strategy) |
boolean |
contains(V value,
EquivalenceStrategy strategy,
Comparator<V> comparator) |
boolean |
containsEquivalentValue(V value) |
boolean |
containsEquivalentValue(V value,
Comparator<V> comparator) |
ItemDelta<V,D> |
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition
represents (e.g.
|
ItemDelta<V,D> |
createDelta(ItemPath path) |
ItemDelta<V,D> |
diff(Item<V,D> other)
Computes a difference (delta) with the specified item using IGNORE_METADATA_CONSIDER_DIFFERENT_IDS equivalence strategy.
|
ItemDelta<V,D> |
diff(Item<V,D> other,
ParameterizedEquivalenceStrategy strategy)
Computes a difference (delta) with the specified item using given equivalence strategy.
|
boolean |
equals(Object obj)
Compares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).
|
boolean |
equals(Object obj,
EquivalenceStrategy equivalenceStrategy)
Compares this item to the specified object under given strategy.
|
boolean |
equals(Object obj,
ParameterizedEquivalenceStrategy equivalenceStrategy)
Compares this item to the specified object under given strategy.
|
void |
filterValues(Function<V,Boolean> function) |
Object |
find(ItemPath path)
Returns object (Item or PrismValue) pointed to by the given path.
|
<IV extends PrismValue,ID extends ItemDefinition> |
findPartial(ItemPath path) |
V |
findValue(V value,
EquivalenceStrategy strategy) |
static Collection<PrismValue> |
getAllValues(Item<?,?> item,
ItemPath path) |
Collection<PrismValue> |
getAllValues(ItemPath path) |
V |
getAnyValue()
Returns any of the values.
|
Collection<V> |
getClonedValues() |
D |
getDefinition()
Returns applicable definition.
|
String |
getDisplayName()
Returns a display name for the item.
|
ItemName |
getElementName()
Returns the name of the item.
|
String |
getHelp()
Returns help message defined for the item.
|
Long |
getHighestId() |
PrismContainerValue<?> |
getParent()
Returns the parent of this item (if exists).
|
ItemPath |
getPath()
Returns the path of this item (sequence of names from the "root" container or similar object to this item).
|
PrismContext |
getPrismContext() |
PrismContext |
getPrismContextLocal() |
Object |
getRealValue()
Returns the "real value" (content) of this item:
- value contained in PrismPropertyValue
- Referencable in PrismReferenceValue
- Containerable in PrismContainerValue
- Objectable in PrismObjectValue
Note that the real value can contain operational items.
|
Collection<?> |
getRealValues()
Returns (potentially empty) collection of "real values".
|
Map<String,Object> |
getUserData()
Returns the "user data", a map that allows attaching arbitrary named data to this item.
|
<T> T |
getUserData(String key)
Returns the user data for the given key (name).
|
V |
getValue()
Returns the value, if there is only one.
|
List<V> |
getValues()
Returns the values for this item.
|
static <V extends PrismValue> |
getValues(Item<V,?> item) |
boolean |
hasCompleteDefinition()
Returns true if this item and all contained items have proper definition.
|
int |
hashCode()
Computes hash code to be used under NOT_LITERAL equivalence strategy.
|
int |
hashCode(EquivalenceStrategy equivalenceStrategy)
Computes hash code to be used under given equivalence strategy.
|
int |
hashCode(ParameterizedEquivalenceStrategy equivalenceStrategy)
Computes hash code to be used under given equivalence strategy.
|
boolean |
hasNoValues() |
static boolean |
hasNoValues(Item<?,?> item) |
boolean |
hasRaw()
Returns true is at least one of the values is raw.
|
boolean |
isEmpty() |
boolean |
isImmutable() |
boolean |
isIncomplete()
Flag that indicates incomplete item.
|
boolean |
isOperational()
Returns true if this item is metadata item that should be ignored
for metadata-insensitive comparisons and hashCode functions.
|
boolean |
isRaw()
Returns true is all the values are raw.
|
boolean |
isSingleValue()
Returns true if the item contains 0 or 1 values and (by definition) is not multivalued.
|
void |
merge(Item<V,D> otherItem)
Merge all the values of other item to this item.
|
void |
modifyUnfrozen(Consumer<Item<V,D>> mutator) |
void |
modifyUnfrozen(Runnable mutator) |
void |
normalize() |
void |
recomputeAllValues()
Re-apply PolyString (and possible other) normalizations to the object.
|
boolean |
remove(V value)
Removes given value from the item.
|
boolean |
remove(V value,
EquivalenceStrategy strategy)
Removes values equivalent to given value from the item; under specified equivalence strategy
OR when values represent the same value via "representsSameValue(.., lax=false)" method.
|
boolean |
removeAll(Collection<V> values)
Removes all given values from the item.
|
void |
replace(V newValue)
Replaces all values of the item by given value.
|
void |
replaceAll(Collection<V> newValues,
EquivalenceStrategy strategy)
Replaces all values of the item by given values.
|
static <T extends Item> |
resetParentCollection(Collection<T> items)
Sets all parents to null.
|
void |
revive(PrismContext prismContext) |
void |
setDefinition(D definition)
Sets applicable item definition.
|
void |
setElementName(QName elementName)
Sets the name of the item.
|
void |
setImmutable(boolean immutable) |
void |
setIncomplete(boolean incomplete)
Flags the item as incomplete.
|
void |
setParent(PrismContainerValue<?> parentValue)
Sets the parent of this item.
|
void |
setPrismContext(PrismContext prismContext) |
void |
setUserData(String key,
Object value)
Sets the user data for the given key (name).
|
int |
size()
Returns the number of values for this item.
|
boolean |
valuesEqual(Collection<V> matchValues,
Comparator<V> comparator) |
debugDump, debugDump, debugDumpLazily, debugDumpLazily
accept
D getDefinition()
May return null if no definition is applicable or the definition is not known.
getDefinition
in interface Itemable
boolean hasCompleteDefinition()
ItemName getElementName()
The name is a QName. It uniquely defines an item.
The name may be null, but such an item will not work.
The name is the QName of XML element in the XML representation.
getElementName
in interface Itemable
void setElementName(QName elementName)
The name is a QName. It uniquely defines an item.
The name may be null, but such an item will not work.
The name is the QName of XML element in the XML representation.
elementName
- the name to set
TODO consider removing this methodvoid setDefinition(@Nullable D definition)
definition
- the definition to set
TODO consider removing this methodString getDisplayName()
Returns null if the display name cannot be determined.
The display name is fetched from the definition. If no definition (schema) is available, the display name will not be returned.
String getHelp()
Returns null if the help message cannot be determined.
The help message is fetched from the definition. If no definition (schema) is available, the help message will not be returned.
boolean isIncomplete()
void setIncomplete(boolean incomplete)
incomplete
- The new valueisIncomplete()
@Nullable PrismContainerValue<?> getParent()
void setParent(@Nullable PrismContainerValue<?> parentValue)
parentValue
- The new parent@NotNull ItemPath getPath()
@NotNull Map<String,Object> getUserData()
<T> T getUserData(String key)
@NotNull List<V> getValues()
int size()
V getAnyValue()
V getValue()
@Nullable Object getRealValue()
@NotNull Collection<?> getRealValues()
getRealValue().
boolean isSingleValue()
boolean add(@NotNull V newValue, boolean checkUniqueness) throws SchemaException
SchemaException
boolean add(@NotNull V newValue) throws SchemaException
SchemaException
boolean add(@NotNull V newValue, @NotNull EquivalenceStrategy equivalenceStrategy) throws SchemaException
SchemaException
boolean addAll(Collection<V> newValues) throws SchemaException
SchemaException
boolean addAll(Collection<V> newValues, EquivalenceStrategy strategy) throws SchemaException
SchemaException
boolean remove(V value)
boolean remove(V value, @NotNull EquivalenceStrategy strategy)
boolean removeAll(Collection<V> values)
void clear()
void replaceAll(Collection<V> newValues, EquivalenceStrategy strategy) throws SchemaException
SchemaException
void replace(V newValue) throws SchemaException
SchemaException
boolean equals(Object obj)
boolean equals(Object obj, @NotNull EquivalenceStrategy equivalenceStrategy)
boolean equals(Object obj, @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
int hashCode()
int hashCode(@NotNull EquivalenceStrategy equivalenceStrategy)
int hashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
boolean contains(V value)
boolean contains(V value, @NotNull EquivalenceStrategy strategy)
boolean contains(V value, @Nullable EquivalenceStrategy strategy, @Nullable Comparator<V> comparator)
boolean containsEquivalentValue(V value)
containsEquivalentValue(PrismValue, Comparator)
with comparator being null)boolean containsEquivalentValue(V value, @Nullable Comparator<V> comparator)
V findValue(V value, @NotNull EquivalenceStrategy strategy)
boolean valuesEqual(Collection<V> matchValues, @Nullable Comparator<V> comparator)
ItemDelta<V,D> diff(Item<V,D> other)
ItemDelta<V,D> diff(Item<V,D> other, @NotNull ParameterizedEquivalenceStrategy strategy)
Collection<V> getClonedValues()
void normalize()
void merge(Item<V,D> otherItem) throws SchemaException
SchemaException
<IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
ItemDelta<V,D> createDelta()
void acceptParentVisitor(@NotNull Visitor visitor)
acceptParentVisitor
in interface ParentVisitable
void recomputeAllValues()
void applyDefinition(D definition) throws SchemaException
SchemaException
void applyDefinition(D definition, boolean force) throws SchemaException
SchemaException
void revive(PrismContext prismContext) throws SchemaException
revive
in interface Revivable
SchemaException
Item clone()
Item cloneComplex(CloneStrategy strategy)
CloneStrategy
static <T extends Item> Collection<T> cloneCollection(Collection<T> items)
static <T extends Item> Collection<T> resetParentCollection(Collection<T> items)
void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
void checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
void checkConsistence()
void checkConsistence(ConsistencyCheckScope scope)
void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
void assertDefinitions() throws SchemaException
SchemaException
void assertDefinitions(String sourceDescription) throws SchemaException
SchemaException
void assertDefinitions(boolean tolerateRawValues, String sourceDescription) throws SchemaException
SchemaException
boolean isRaw()
boolean hasRaw()
boolean isEmpty()
boolean hasNoValues()
static boolean hasNoValues(Item<?,?> item)
boolean isOperational()
boolean isImmutable()
void setImmutable(boolean immutable)
void checkImmutability()
void modifyUnfrozen(Runnable mutator)
@NotNull static <V extends PrismValue> Collection<V> getValues(Item<V,?> item)
@NotNull Collection<PrismValue> getAllValues(ItemPath path)
@NotNull static Collection<PrismValue> getAllValues(Item<?,?> item, ItemPath path)
PrismContext getPrismContext()
getPrismContext
in interface Itemable
PrismContext getPrismContextLocal()
void setPrismContext(PrismContext prismContext)
Long getHighestId()
Copyright © 2020 Evolveum. All rights reserved.