Class VariablesMap
java.lang.Object
com.evolveum.midpoint.schema.expression.VariablesMap
- All Implemented Interfaces:
DebugDumpable
,Map<String,
TypedValue<?>>
- Author:
- semancik
-
Nested Class Summary
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<D extends ItemDefinition<?>>
voidaddVariableDefinition
(String name, Object value, D definition) void
addVariableDefinitions
(VariablesMap extraVariables) Adds map of extra variables to the expression.void
addVariableDefinitions
(VariablesMap extraVariables, @NotNull Collection<String> exceptFor) void
addVariableDefinitionsNew
(VariablesMap extraVariables) Adds map of extra variables to the expression.void
addVariableDefinitionsOld
(VariablesMap extraVariables) Adds map of extra variables to the expression.void
addVariableWithDeterminedDefinition
(@NotNull String name, @NotNull ObjectType value) Tries to determine the definition of the variable value.void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) static VariablesMap
create
(PrismContext prismContext, Object... parameters) Expects name-value-definition triplets.debugDump
(int indent) static VariablesMap
emptyMap()
@NotNull Set<Map.Entry<String,
TypedValue<?>>> entrySet()
boolean
TypedValue<?>
@NotNull Collection<String>
getAliases
(String key) getAliasResolution
(String key) <T> T
<O extends ObjectType>
PrismObject<O>getValueNew
(String name) int
hashCode()
boolean
boolean
boolean
isEmpty()
keySet()
TypedValue<?>
put
(String key, TypedValue<?> typedValue) <D extends ItemDefinition>
TypedValue<T> TypedValue<?>
Note: Type of the value should really be Object and not T.void
putAll
(@NotNull Map<? extends String, ? extends TypedValue<?>> m) void
<T> TypedValue<List<T>>
Convenience method to put multivalue variables (lists).<O extends ObjectType>
TypedValue<O>putObject
(String key, PrismObject<O> object, Class<O> expectedClass) Convenience method to put objects with definition.<O extends ObjectType>
TypedValue<O>Convenience method to put objects with definition.void
registerAlias
(String alias, @Nullable String realName) void
Use only if you previously register all variables from this map!TypedValue<?>
<D extends ItemDefinition<?>>
voidreplaceVariableDefinition
(String name, Object value, D definition) void
setRootNode
(ObjectReferenceType objectRef, PrismReferenceDefinition def) @NotNull VariablesMap
int
size()
toString()
void
unregisterAlias
(String alias) @NotNull Collection<TypedValue<?>>
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
VariablesMap
public VariablesMap()
-
-
Method Details
-
size
public int size()- Specified by:
size
in interfaceMap<String,
TypedValue<?>>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMap<String,
TypedValue<?>>
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,
TypedValue<?>>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
TypedValue<?>>
-
get
- Specified by:
get
in interfaceMap<String,
TypedValue<?>>
-
put
- Specified by:
put
in interfaceMap<String,
TypedValue<?>>
-
registerAlias
-
registerAliasesFrom
Use only if you previously register all variables from this map! -
unregisterAlias
-
put
-
put
Note: Type of the value should really be Object and not T. The value may be quite complicated, e.g. it may be ItemDeltaItem of the actual real value. However, the class defines the real type of the value precisely. -
putObject
public <O extends ObjectType> TypedValue<O> putObject(String key, O objectType, Class<O> expectedClass) Convenience method to put objects with definition. Maybe later improve by looking up full definition. -
putObject
public <O extends ObjectType> TypedValue<O> putObject(String key, PrismObject<O> object, Class<O> expectedClass) Convenience method to put objects with definition. Maybe later improve by looking up full definition. -
putList
Convenience method to put multivalue variables (lists). This is very simple now. But later on we may need to declare generics. Therefore dedicated method would be easier to find all usages and fix them. -
remove
- Specified by:
remove
in interfaceMap<String,
TypedValue<?>>
-
putAll
- Specified by:
putAll
in interfaceMap<String,
TypedValue<?>>
-
putAll
-
clear
public void clear()- Specified by:
clear
in interfaceMap<String,
TypedValue<?>>
-
keySet
- Specified by:
keySet
in interfaceMap<String,
TypedValue<?>>
-
values
- Specified by:
values
in interfaceMap<String,
TypedValue<?>>
-
entrySet
- Specified by:
entrySet
in interfaceMap<String,
TypedValue<?>>
-
create
@VisibleForTesting public static VariablesMap create(PrismContext prismContext, Object... parameters) Expects name-value-definition triplets. Definition can be just a type QName. E.g. create(var1name, var1value, var1type, var2name, var2value, var2type, ...) Mostly for testing. Use at your own risk. -
emptyMap
-
formatVariables
-
getAliases
-
isAlias
-
getAliasResolution
-
dumpSingleLine
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
addVariableDefinitions
Adds map of extra variables to the expression. If there are variables with deltas (ObjectDeltaObject) the operation fail because it cannot decide which version to use. -
addVariableDefinitions
public void addVariableDefinitions(VariablesMap extraVariables, @NotNull @NotNull Collection<String> exceptFor) -
addVariableDefinitionsOld
Adds map of extra variables to the expression. If there are variables with deltas (ObjectDeltaObject) it takes the "old" version of the object. -
addVariableDefinitionsNew
Adds map of extra variables to the expression. If there are variables with deltas (ObjectDeltaObject) it takes the "new" version of the object. -
setRootNode
-
addVariableWithDeterminedDefinition
public void addVariableWithDeterminedDefinition(@NotNull @NotNull String name, @NotNull @NotNull ObjectType value) Tries to determine the definition of the variable value. -
addVariableDefinition
public <D extends ItemDefinition<?>> void addVariableDefinition(String name, Object value, D definition) -
replaceVariableDefinition
public <D extends ItemDefinition<?>> void replaceVariableDefinition(String name, Object value, D definition) -
getValue
-
getValue
- Throws:
SchemaException
-
getValueNew
- Throws:
SchemaException
-
haveDeltas
public boolean haveDeltas() -
equals
-
hashCode
public int hashCode() -
toString
-
shallowClone
-