public abstract class Item<V extends PrismValue,D extends ItemDefinition> extends Object implements Itemable, DebugDumpable, Visitable, PathVisitable, Serializable, Revivable
This is supposed to be a superclass for all items. Items are things that can appear in property containers, which generally means only a property and property container itself. Therefore this is in fact superclass for those two definitions.
Modifier and Type | Field and Description |
---|---|
protected D |
definition |
protected QName |
elementName |
protected boolean |
immutable |
protected boolean |
incomplete |
protected PrismValue |
parent |
protected PrismContext |
prismContext |
protected List<V> |
values |
INDENT_STRING
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor) |
void |
accept(Visitor visitor,
ItemPath path,
boolean recursive) |
boolean |
add(V newValue) |
boolean |
add(V newValue,
boolean checkUniqueness) |
boolean |
addAll(Collection<V> newValues) |
protected void |
appendDebugDumpSuffix(StringBuilder sb) |
void |
applyDefinition(D definition) |
void |
applyDefinition(D definition,
boolean force) |
void |
assertDefinitions() |
void |
assertDefinitions(boolean tolarateRawValues,
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) |
protected abstract void |
checkDefinition(D def) |
void |
checkImmutability() |
protected void |
checkMutability() |
void |
clear() |
abstract Item |
clone()
Literal clone.
|
static <T extends Item> |
cloneCollection(Collection<T> items) |
abstract Item |
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.
|
boolean |
contains(V value) |
boolean |
contains(V value,
boolean ignoreMetadata) |
boolean |
contains(V value,
boolean ignoreMetadata,
Comparator<V> comparator) |
boolean |
containsEquivalentValue(V value) |
boolean |
containsEquivalentValue(V value,
Comparator<V> comparator) |
boolean |
containsRealValue(V value) |
protected void |
copyValues(CloneStrategy strategy,
Item clone) |
abstract ItemDelta<V,D> |
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition
represents (e.g.
|
abstract ItemDelta<V,D> |
createDelta(ItemPath path) |
static <T extends Item> |
createNewDefinitionlessItem(QName name,
Class<T> type,
PrismContext prismContext) |
String |
debugDump(int indent) |
ItemDelta<V,D> |
diff(Item<V,D> other) |
ItemDelta<V,D> |
diff(Item<V,D> other,
boolean ignoreMetadata,
boolean isLiteral) |
protected void |
diffInternal(Item<V,D> other,
Collection<? extends ItemDelta> deltas,
boolean ignoreMetadata,
boolean isLiteral) |
boolean |
equals(Object obj) |
boolean |
equalsRealValue(Object obj) |
void |
filterValues(Function<V,Boolean> function) |
abstract Object |
find(ItemPath path) |
abstract <IV extends PrismValue,ID extends ItemDefinition> |
findPartial(ItemPath path) |
PrismValue |
findValue(PrismValue value,
boolean ignoreMetadata)
Returns value that is equal or equivalent to the provided value.
|
List<? extends PrismValue> |
findValuesIgnoreMetadata(PrismValue value) |
protected ItemDelta<V,D> |
fixupDelta(ItemDelta<V,D> delta,
Item<V,D> other,
boolean ignoreMetadata) |
static Collection<PrismValue> |
getAllValues(Item<?,?> item,
ItemPath path) |
Collection<PrismValue> |
getAllValues(ItemPath path) |
Collection<V> |
getClonedValues() |
protected String |
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.
|
D |
getDefinition()
Returns applicable property definition.
|
String |
getDisplayName()
Returns a display name for the property type.
|
QName |
getElementName()
Returns the name of the property.
|
String |
getHelp()
Returns help message defined for the property type.
|
PrismValue |
getNextValue(PrismValue value)
Returns values that is following the specified value.
|
PrismValue |
getParent() |
ItemPath |
getPath() |
PrismValue |
getPreviousValue(PrismValue value)
Returns value that is previous to the specified value.
|
PrismContext |
getPrismContext() |
PrismContext |
getPrismContextLocal() |
abstract <X> X |
getRealValue() |
abstract <X> Collection<X> |
getRealValues() |
Map<String,Object> |
getUserData() |
<T> T |
getUserData(String key) |
V |
getValue(int index) |
List<V> |
getValues() |
static <V extends PrismValue> |
getValues(Item<V,?> item) |
boolean |
hasCompleteDefinition() |
int |
hashCode() |
boolean |
hasNoValues() |
static boolean |
hasNoValues(Item<?,?> item) |
boolean |
hasRaw()
Returns true is at least one of the values is raw.
|
boolean |
hasRealValue(PrismValue value) |
boolean |
hasValue(PrismValue value) |
boolean |
hasValue(PrismValue value,
boolean ignoreMetadata) |
boolean |
isEmpty() |
boolean |
isImmutable() |
boolean |
isIncomplete()
Flag that indicates incomplete item.
|
boolean |
isMetadata()
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() |
boolean |
match(Object obj) |
void |
merge(Item<V,D> otherItem)
Merge all the values of other item to this item.
|
void |
modifyUnfrozen(Runnable mutator) |
void |
normalize() |
protected void |
propagateDeepCloneDefinition(boolean ultraDeep,
D clonedDefinition,
Consumer<ItemDefinition> postCloneAction) |
void |
recomputeAllValues()
Re-apply PolyString (and possible other) normalizations to the object.
|
V |
remove(int index) |
boolean |
remove(V newValue) |
boolean |
removeAll(Collection<V> newValues) |
void |
replace(V newValue) |
void |
replaceAll(Collection<V> newValues) |
static <T extends Item> |
resetParentCollection(Collection<T> items)
Sets all parents to null.
|
void |
revive(PrismContext prismContext) |
void |
setDefinition(D definition)
Sets applicable property definition.
|
void |
setElementName(QName elementName)
Sets the name of the property.
|
void |
setImmutable(boolean immutable) |
void |
setIncomplete(boolean incomplete) |
void |
setParent(PrismValue parentValue) |
void |
setPrismContext(PrismContext prismContext) |
void |
setUserData(String key,
Object value) |
int |
size() |
String |
toString() |
boolean |
valuesExactMatch(Collection<V> matchValues,
Comparator<V> comparator) |
finalize, getClass, notify, notifyAll, wait, wait, wait
debugDump, debugDumpLazily, debugDumpLazily
protected QName elementName
protected PrismValue parent
protected D extends ItemDefinition definition
@NotNull protected final List<V extends PrismValue> values
protected boolean immutable
protected boolean incomplete
protected transient PrismContext prismContext
public D getDefinition()
May return null if no definition is applicable or the definition is not know.
getDefinition
in interface Itemable
public boolean hasCompleteDefinition()
public QName getElementName()
The name is a QName. It uniquely defines a property.
The name may be null, but such a property will not work.
The name is the QName of XML element in the XML representation.
getElementName
in interface Itemable
public void setElementName(QName elementName)
The name is a QName. It uniquely defines a property.
The name may be null, but such a property will not work.
The name is the QName of XML element in the XML representation.
elementName
- the name to setpublic void setDefinition(D definition)
definition
- the definition to setpublic String 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.
public 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.
public boolean isIncomplete()
public void setIncomplete(boolean incomplete)
public PrismContext getPrismContext()
getPrismContext
in interface Itemable
public PrismContext getPrismContextLocal()
public void setPrismContext(PrismContext prismContext)
public PrismValue getParent()
public void setParent(PrismValue parentValue)
public <T> T getUserData(String key)
public V getValue(int index)
public abstract <X> X getRealValue()
@NotNull public abstract <X> Collection<X> getRealValues()
public boolean hasValue(PrismValue value, boolean ignoreMetadata)
public boolean hasValue(PrismValue value)
public boolean hasRealValue(PrismValue value)
public boolean isSingleValue()
public PrismValue findValue(PrismValue value, boolean ignoreMetadata)
public List<? extends PrismValue> findValuesIgnoreMetadata(PrismValue value)
public PrismValue getPreviousValue(PrismValue value)
public PrismValue getNextValue(PrismValue value)
public Collection<V> getClonedValues()
public boolean contains(V value)
public boolean containsEquivalentValue(V value)
public boolean containsEquivalentValue(V value, Comparator<V> comparator)
public boolean contains(V value, boolean ignoreMetadata, Comparator<V> comparator)
public boolean contains(V value, boolean ignoreMetadata)
public boolean containsRealValue(V value)
public boolean valuesExactMatch(Collection<V> matchValues, Comparator<V> comparator)
public int size()
public boolean addAll(Collection<V> newValues) throws SchemaException
SchemaException
public boolean add(@NotNull V newValue) throws SchemaException
SchemaException
public boolean add(@NotNull V newValue, boolean checkUniqueness) throws SchemaException
SchemaException
public boolean removeAll(Collection<V> newValues)
public boolean remove(V newValue)
public V remove(int index)
public void replaceAll(Collection<V> newValues) throws SchemaException
SchemaException
public void replace(V newValue)
public void clear()
public void normalize()
public void merge(Item<V,D> otherItem) throws SchemaException
SchemaException
public abstract <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
protected void diffInternal(Item<V,D> other, Collection<? extends ItemDelta> deltas, boolean ignoreMetadata, boolean isLiteral)
protected ItemDelta<V,D> fixupDelta(ItemDelta<V,D> delta, Item<V,D> other, boolean ignoreMetadata)
public abstract ItemDelta<V,D> createDelta()
public void accept(Visitor visitor, ItemPath path, boolean recursive)
accept
in interface PathVisitable
public void recomputeAllValues()
public void applyDefinition(D definition) throws SchemaException
SchemaException
public void applyDefinition(D definition, boolean force) throws SchemaException
SchemaException
public void revive(PrismContext prismContext) throws SchemaException
revive
in interface Revivable
SchemaException
public abstract Item cloneComplex(CloneStrategy strategy)
CloneStrategy
protected void copyValues(CloneStrategy strategy, Item clone)
protected void propagateDeepCloneDefinition(boolean ultraDeep, D clonedDefinition, Consumer<ItemDefinition> postCloneAction)
public static <T extends Item> Collection<T> cloneCollection(Collection<T> items)
public static <T extends Item> Collection<T> resetParentCollection(Collection<T> items)
public static <T extends Item> T createNewDefinitionlessItem(QName name, Class<T> type, PrismContext prismContext)
public void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
public void checkConsistence()
public void checkConsistence(ConsistencyCheckScope scope)
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
protected abstract void checkDefinition(D def)
public void assertDefinitions() throws SchemaException
SchemaException
public void assertDefinitions(String sourceDescription) throws SchemaException
SchemaException
public void assertDefinitions(boolean tolarateRawValues, String sourceDescription) throws SchemaException
SchemaException
public boolean isRaw()
public boolean hasRaw()
public boolean isEmpty()
public boolean hasNoValues()
public static boolean hasNoValues(Item<?,?> item)
public boolean equalsRealValue(Object obj)
public boolean match(Object obj)
public boolean isMetadata()
public String debugDump(int indent)
debugDump
in interface DebugDumpable
protected String getDebugDumpClassName()
protected void appendDebugDumpSuffix(StringBuilder sb)
public boolean isImmutable()
public void setImmutable(boolean immutable)
protected void checkMutability()
public void checkImmutability()
public void modifyUnfrozen(Runnable mutator)
@NotNull public static <V extends PrismValue> Collection<V> getValues(Item<V,?> item)
@NotNull public Collection<PrismValue> getAllValues(ItemPath path)
@NotNull public static Collection<PrismValue> getAllValues(Item<?,?> item, ItemPath path)
Copyright © 2019 Evolveum. All rights reserved.