com.evolveum.midpoint.prism
Class PrismProperty<T>

java.lang.Object
  extended by com.evolveum.midpoint.prism.Item<PrismPropertyValue<T>>
      extended by com.evolveum.midpoint.prism.PrismProperty<T>
All Implemented Interfaces:
Itemable, Visitable, DebugDumpable, Dumpable, Serializable
Direct Known Subclasses:
ResourceAttribute

public class PrismProperty<T>
extends Item<PrismPropertyValue<T>>

Property is a specific characteristic of an object. It may be considered object "attribute" or "field". For example User has fullName property that contains string value of user's full name.

Properties may be single-valued or multi-valued

Properties may contain primitive types or complex types (defined by XSD schema)

Property values are unordered, implementation may change the order of values

Duplicate values of properties should be silently removed by implementations, but clients must be able tolerate presence of duplicate values.

Operations that modify the objects work with the granularity of properties. They add/remove/replace the values of properties, but do not "see" inside the property.

Property is mutable.

Author:
Radovan Semancik
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.evolveum.midpoint.prism.Item
definition, name, parent, prismContext
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
  PrismProperty(QName name)
           
protected PrismProperty(QName name, PrismPropertyDefinition definition, PrismContext prismContext)
           
 
Method Summary
 void addRealValue(T valueToAdd)
           
 void addValue(PrismPropertyValue<T> pValueToAdd)
           
 void addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)
           
protected  void checkDefinition(ItemDefinition def)
           
 PrismProperty<T> clone()
           
protected  void copyValues(PrismProperty<T> clone)
           
 PropertyDelta<T> createDelta(ItemPath path)
          Creates specific sublcass of ItemDelta appropriate for type of item that this definition represents (e.g.
 String debugDump(int indent)
           
 boolean deleteValue(PrismPropertyValue<T> pValueToDelete)
           
 boolean deleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)
           
 PropertyDelta<T> diff(PrismProperty<T> other, ItemPath pathPrefix)
           
 PropertyDelta<T> diff(PrismProperty<T> other, ItemPath pathPrefix, boolean ignoreMetadata, boolean isLiteral)
           
 boolean equals(Object obj)
           
protected  ItemDelta fixupDelta(ItemDelta delta, Item otherItem, ItemPath pathPrefix, boolean ignoreMetadata)
           
 T getAnyRealValue()
           
protected  String getDebugDumpClassName()
          Return a human readable name of this class suitable for logs.
 PrismPropertyDefinition getDefinition()
          Returns applicable property definition.
 String getHumanReadableDump()
           
 PrismPropertyValue<T> getNextValue(PrismValue value)
          Returns values that is following the specified value.
 PrismPropertyValue<T> getPreviousValue(PrismValue value)
          Returns value that is previous to the specified value.
 T getRealValue()
           
<X> X
getRealValue(Class<X> type)
          Type override, also for compatibility.
 Collection<T> getRealValues()
           
<X> Collection<X>
getRealValues(Class<X> type)
          Type override, also for compatibility.
<X> X[]
getRealValuesArray(Class<X> type)
          Type override, also for compatibility.
 PrismPropertyValue<T> getValue()
           
<X> PrismPropertyValue<X>
getValue(Class<X> type)
          Type override, also for compatibility.
 Class<T> getValueClass()
           
 List<PrismPropertyValue<T>> getValues()
          Returns property values.
<X> List<PrismPropertyValue<X>>
getValues(Class<X> type)
          Type override, also for compatibility.
 int hashCode()
           
 boolean hasRealValue(PrismPropertyValue<T> value)
           
 boolean hasValue(PrismPropertyValue<T> value)
           
 void replaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)
           
 void setDefinition(PrismPropertyDefinition definition)
          Sets applicable property definition.
 void setRealValue(Object realValue)
           
 void setValue(PrismPropertyValue<T> value)
          Means as a short-hand for setting just a value for single-valued attributes.
 String toString()
           
 
Methods inherited from class com.evolveum.midpoint.prism.Item
accept, add, addAll, applyDefinition, applyDefinition, asDomElements, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, cloneCollection, contains, contains, containsEquivalentValue, containsRealValue, copyValues, createNewDefinitionlessItem, debugDump, diff, diff, diff, diffInternal, dump, equalsRealValue, findValue, getClonedValues, getDisplayName, getHelp, getName, getParent, getPath, getPrismContext, getUserData, getUserData, getValue, hasCompleteDefinition, hasRaw, hasRealValue, hasValue, hasValue, isEmpty, isRaw, normalize, remove, remove, removeAll, replace, replaceAll, resetParentCollection, revive, setDefinition, setName, setParent, setPrismContext, setUserData, size
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrismProperty

public PrismProperty(QName name)

PrismProperty

protected PrismProperty(QName name,
                        PrismPropertyDefinition definition,
                        PrismContext prismContext)
Method Detail

getDefinition

public PrismPropertyDefinition getDefinition()
Returns applicable property definition.

May return null if no definition is applicable or the definition is not know.

Specified by:
getDefinition in interface Itemable
Overrides:
getDefinition in class Item<PrismPropertyValue<T>>
Returns:
applicable property definition

setDefinition

public void setDefinition(PrismPropertyDefinition definition)
Sets applicable property definition.

Parameters:
definition - the definition to set

getValues

public List<PrismPropertyValue<T>> getValues()
Returns property values.

The values are returned as set. The order of values is not significant.

Overrides:
getValues in class Item<PrismPropertyValue<T>>
Returns:
property values

getValue

public PrismPropertyValue<T> getValue()

getValues

public <X> List<PrismPropertyValue<X>> getValues(Class<X> type)
Type override, also for compatibility.


getRealValues

public Collection<T> getRealValues()

getRealValues

public <X> Collection<X> getRealValues(Class<X> type)
Type override, also for compatibility.


getAnyRealValue

public T getAnyRealValue()

getRealValue

public T getRealValue()

getRealValue

public <X> X getRealValue(Class<X> type)
Type override, also for compatibility.


getRealValuesArray

public <X> X[] getRealValuesArray(Class<X> type)
Type override, also for compatibility.


getValue

public <X> PrismPropertyValue<X> getValue(Class<X> type)
Type override, also for compatibility.


setValue

public void setValue(PrismPropertyValue<T> value)
Means as a short-hand for setting just a value for single-valued attributes. Will remove all existing values. TODO


setRealValue

public void setRealValue(Object realValue)

addValues

public void addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)

addValue

public void addValue(PrismPropertyValue<T> pValueToAdd)

addRealValue

public void addRealValue(T valueToAdd)

deleteValues

public boolean deleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)

deleteValue

public boolean deleteValue(PrismPropertyValue<T> pValueToDelete)

replaceValues

public void replaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)

hasValue

public boolean hasValue(PrismPropertyValue<T> value)

hasRealValue

public boolean hasRealValue(PrismPropertyValue<T> value)

getPreviousValue

public PrismPropertyValue<T> getPreviousValue(PrismValue value)
Description copied from class: Item
Returns value that is previous to the specified value. Note that the order is semantically insignificant and this is used only for presentation consistency in order-sensitive formats such as XML or JSON.

Overrides:
getPreviousValue in class Item<PrismPropertyValue<T>>

getNextValue

public PrismPropertyValue<T> getNextValue(PrismValue value)
Description copied from class: Item
Returns values that is following the specified value. Note that the order is semantically insignificant and this is used only for presentation consistency in order-sensitive formats such as XML or JSON.

Overrides:
getNextValue in class Item<PrismPropertyValue<T>>

getValueClass

public Class<T> getValueClass()

createDelta

public PropertyDelta<T> createDelta(ItemPath path)
Description copied from class: Item
Creates specific sublcass of ItemDelta appropriate for type of item that this definition represents (e.g. PropertyDelta, ContainerDelta, ...)

Specified by:
createDelta in class Item<PrismPropertyValue<T>>

diff

public PropertyDelta<T> diff(PrismProperty<T> other,
                             ItemPath pathPrefix)

diff

public PropertyDelta<T> diff(PrismProperty<T> other,
                             ItemPath pathPrefix,
                             boolean ignoreMetadata,
                             boolean isLiteral)

checkDefinition

protected void checkDefinition(ItemDefinition def)
Specified by:
checkDefinition in class Item<PrismPropertyValue<T>>

clone

public PrismProperty<T> clone()
Specified by:
clone in class Item<PrismPropertyValue<T>>

copyValues

protected void copyValues(PrismProperty<T> clone)

hashCode

public int hashCode()
Overrides:
hashCode in class Item<PrismPropertyValue<T>>

equals

public boolean equals(Object obj)
Overrides:
equals in class Item<PrismPropertyValue<T>>

fixupDelta

protected ItemDelta fixupDelta(ItemDelta delta,
                               Item otherItem,
                               ItemPath pathPrefix,
                               boolean ignoreMetadata)
Overrides:
fixupDelta in class Item<PrismPropertyValue<T>>

toString

public String toString()
Overrides:
toString in class Item<PrismPropertyValue<T>>

debugDump

public String debugDump(int indent)
Specified by:
debugDump in interface DebugDumpable
Overrides:
debugDump in class Item<PrismPropertyValue<T>>

getHumanReadableDump

public String getHumanReadableDump()

getDebugDumpClassName

protected String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.

Overrides:
getDebugDumpClassName in class Item<PrismPropertyValue<T>>


Copyright © 2013 evolveum. All Rights Reserved.