Package com.uc4.api.objects
Class ObjectValues
java.lang.Object
com.uc4.api.objects.ObjectValues
This class contains values and PromptSets of executable Objects.
The object that contains an
ObjectValues
must implement the
LifecycleSaveAware
interface and call the values.cleanAfterSave()
.-
Method Summary
Modifier and TypeMethodDescriptionReturns an iterator overPromptSetDefinition
, Iterates over only non deleted entries.void
Adds a new PromptSet to this object.void
Adds a new key and value to this object.void
Adds a new key,value and ErtUsage to this object.void
Clear the internal state after a save was performed on the object.getErtUsage
(String validityKeyword) Returns the ertUsage for a given validity keyword The method returnsErtUsage.NONE
if the validity keyword does not exist.int
Returns an integer which describes how variable values are inherited from its parent.Returns the value for a given validity keyword The method returnsnull
if the validity keyword does not exist.Returns an iterator overPromptSetDefinition
.int
void
rearrange
(List<PromptSetDefinition> orderedPromptSets) This method can be used to rearrange the prompt sets.void
Removes all entries (Values and PromptSets).void
Removes all the variables storedvoid
Removes all PromptSets.boolean
removeValue
(String validityKeyword) Removes a variable entry The method returnsfalse
if the validity keyword was not found.void
setInheritFromParent
(int mode) Sets the inherit mode for thisVariableValues
instance.void
This method can be used to update the number of prompt elements based on aPromptSet
object.Returns an iterator over validity keywords.int
-
Method Details
-
valueKeyIterator
Returns an iterator over validity keywords. All validity keywords have the typejava.lang.String
- Returns:
- Iterator
-
promptSetIterator
Returns an iterator overPromptSetDefinition
.- Returns:
- Iterator
-
activePromptSetIterator
Returns an iterator overPromptSetDefinition
, Iterates over only non deleted entries.- Returns:
- Iterator
-
addPromptSet
Adds a new PromptSet to this object. Throws IllegalArgumentException if Object already exists- Parameters:
def
- PromptSetDefinition
-
addValue
Adds a new key and value to this object. The parameterreplace
can be used to define if the value should be replaced in case of an already existing validity keyword.- Parameters:
validityKeyword
- Keyvalue
- Valuereplace
- If true the value will be replaced if a key with this name does already exist
-
addValue
Adds a new key,value and ErtUsage to this object. The parameterreplace
can be used to define if the value should be replaced in case of an already existing validity keyword. Created after addition of new column ErtUsage in v11 of AE.- Parameters:
validityKeyword
- Keyvalue
- ValueertUsage
- Acceptable Ert usage Values are 0 to 5, otherwise ertUsage value will be set to 0 i.e its Default Valuereplace
- If true the value will be replaced if a key with this name does already exist
-
getValue
Returns the value for a given validity keyword The method returnsnull
if the validity keyword does not exist.- Parameters:
validityKeyword
- Key- Returns:
- Value or null if the key does not exist
-
getErtUsage
Returns the ertUsage for a given validity keyword The method returnsErtUsage.NONE
if the validity keyword does not exist.ErtUsage.NONE
is default value of ERT Usage Value.- Parameters:
validityKeyword
- Key- Returns:
- ErtUsage or ErtUsage.NONE if the key does not exist.
-
removeValue
Removes a variable entry The method returnsfalse
if the validity keyword was not found.- Parameters:
validityKeyword
- Key- Returns:
- True if the values was removed
-
removeAllVariablevalues
public void removeAllVariablevalues()Removes all the variables stored -
valueSize
public int valueSize()- Returns:
- Number of entries in the Variable.
-
promptSetSize
public int promptSetSize()- Returns:
- Number of PromptSet entries
-
removeAll
public void removeAll()Removes all entries (Values and PromptSets). -
removePromptSets
public void removePromptSets()Removes all PromptSets. -
cleanAfterSave
public void cleanAfterSave()Clear the internal state after a save was performed on the object. -
setInheritFromParent
public void setInheritFromParent(int mode) Sets the inherit mode for thisVariableValues
instance. Throws IllegalArgumentException if the parameter value is not 0,1 or 2- 0 ... All values
- 1 ... Defined values only
- 2 ... None
- Parameters:
mode
- Inherit mode
-
getInheritFromParent
public int getInheritFromParent()Returns an integer which describes how variable values are inherited from its parent.- 0 ... All values
- 1 ... Defined values only
- 2 ... None
- Returns:
- Inherit mode
-
updateDefinition
This method can be used to update the number of prompt elements based on aPromptSet
object.- Parameters:
set
- PromptSet
-
rearrange
This method can be used to rearrange the prompt sets. Throws IllegalArgumentException if the element of the list is not contained in the valid prompt set list.- Parameters:
orderedPromptSets
- prompt set List in desired order
-