Class TypedValue<T>
- java.lang.Object
-
- com.evolveum.midpoint.schema.expression.TypedValue<T>
-
- All Implemented Interfaces:
ShortDumpable
public class TypedValue<T> extends Object implements ShortDumpable
Value and definition pair. E.g. used in expression variable maps. We need to have explicit type here. It may happen that there will be variables without any value. But we need to know the type of the variable to compile the scripts properly. The definition, typeClass and the T parameter of this class refer to the type of the value as it should appear in the expression. The actual value may be different when TypedValue is created. The value may get converted as it is passing down the stack. E.g. if we want script variable to contain a user, the type should be declared as UserType, not as object reference - even though the value is object reference when the TypedValue is created. But the reference is resolved down the way to place user in the value.- Author:
- Radovan Semancik
-
-
Constructor Summary
Constructors Constructor Description TypedValue()
TypedValue(Item<?,?> prismItem)
TypedValue(Object value, ItemDefinition<?> definition)
TypedValue(Object value, ItemDefinition<?> definition, Class<T> typeClass)
TypedValue(Object value, Class<T> typeClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDetermineType()
TypedValue<T>
createTransformed(Object newValue)
Returns new TypedValue that has a new (transformed) value, but has the same definition.Class<T>
determineClass()
boolean
equals(Object obj)
<D extends ItemDefinition>
DgetDefinition()
Class<T>
getTypeClass()
Object
getValue()
int
hashCode()
void
setDefinition(ItemDefinition<?> definition)
void
setPrismContext(PrismContext prismContext)
void
setTypeClass(Class<T> typeClass)
void
setValue(Object value)
TypedValue<T>
shallowClone()
Returns the shallow clone of the original object.void
shortDump(StringBuilder sb)
Show the content of the object intended for diagnostics.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
-
-
-
Constructor Detail
-
TypedValue
public TypedValue()
-
TypedValue
public TypedValue(Item<?,?> prismItem)
-
TypedValue
public TypedValue(Object value, ItemDefinition<?> definition)
-
TypedValue
public TypedValue(Object value, ItemDefinition<?> definition, Class<T> typeClass)
-
-
Method Detail
-
getValue
public Object getValue()
-
setValue
public void setValue(Object value)
-
getDefinition
public <D extends ItemDefinition> D getDefinition()
-
setDefinition
public void setDefinition(ItemDefinition<?> definition)
-
canDetermineType
public boolean canDetermineType()
-
determineClass
public Class<T> determineClass() throws SchemaException
- Throws:
SchemaException
-
createTransformed
public TypedValue<T> createTransformed(Object newValue)
Returns new TypedValue that has a new (transformed) value, but has the same definition.
-
shallowClone
public TypedValue<T> shallowClone()
Returns the shallow clone of the original object. Value nor definition is copied, NOT cloned.
-
shortDump
public void shortDump(StringBuilder sb)
Description copied from interface:ShortDumpable
Show the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDump
in interfaceShortDumpable
- Parameters:
sb
- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
setPrismContext
public void setPrismContext(PrismContext prismContext)
-
-