Class TypedValue<T>
java.lang.Object
com.evolveum.midpoint.schema.expression.TypedValue<T>
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionTypedValue
(Item<?, ?> prismItem) TypedValue
(Object value, ItemDefinition<?> definition) TypedValue
(Object value, ItemDefinition<?> definition, Class<T> typeClass) TypedValue
(Object value, Class<T> typeClass) -
Method Summary
Modifier and TypeMethodDescriptionboolean
createTransformed
(Object newValue) Returns new TypedValue that has a new (transformed) value, but has the same definition.boolean
<D extends ItemDefinition>
DgetValue()
int
hashCode()
static TypedValue<?>
of
(@NotNull Collection<? extends PrismValue> prismValues, @Nullable QName typeName) Creates aTypedValue
with a collection of real values.static TypedValue<?>
void
setDefinition
(ItemDefinition<?> definition) void
setPrismContext
(PrismContext prismContext) void
setTypeClass
(Class<T> typeClass) void
Returns the shallow clone of the original object.void
Show the content of the object intended for diagnostics.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 Details
-
TypedValue
public TypedValue() -
TypedValue
-
TypedValue
-
TypedValue
-
TypedValue
-
-
Method Details
-
of
@Experimental public static TypedValue<?> of(@NotNull @NotNull Collection<? extends PrismValue> prismValues, @Nullable @Nullable QName typeName) Creates aTypedValue
with a collection of real values. Simple implementation (for now): . assumes the values have the same class; . does NOT unwrap the values into "real values", using them wrapped. (Moved here from `report-impl` module, can be improved later, if needed.)- Parameters:
typeName
- Name of the type, if known
-
of
@Experimental public static TypedValue<?> of(@Nullable @Nullable Object value, @NotNull @NotNull Class<?> defaultClass) -
getValue
-
setValue
-
getDefinition
-
setDefinition
-
getTypeClass
-
setTypeClass
-
canDetermineType
public boolean canDetermineType() -
determineClass
- Throws:
SchemaException
-
createTransformed
Returns new TypedValue that has a new (transformed) value, but has the same definition. -
shallowClone
Returns the shallow clone of the original object. Value nor definition is copied, NOT cloned. -
hashCode
public int hashCode() -
equals
-
toString
-
shortDump
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
-