Interface ICustomNumberField
-
- All Superinterfaces:
ICustomField<Number>
public interface ICustomNumberField extends ICustomField<Number>
- See Also:
ICustomField- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancompareAndSet(Number expectedValue, Number newValue)Sets the givennewValueif the current value of the field is equal to theexpectedValueotherwise the value is not set.NumbergetOrDefault(Number defaultValue)Gets the value of the custom field or the provideddefaultValueif no value has been set.NumbergetOrNull()Gets the value of the custom field or null/default.voidset(Number value)Sets the value of the field.
-
-
-
Method Detail
-
getOrNull
Number getOrNull()
Gets the value of the custom field or null/default.Examples:
String branchOffice = ivy.task.customFields().stringField("branchOffice").getOrNull();- Specified by:
getOrNullin interfaceICustomField<Number>- Returns:
- value or null
- See Also:
ICustomField.getOrDefault(Object),ICustomField.get()- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
getOrDefault
Number getOrDefault(Number defaultValue)
Gets the value of the custom field or the provideddefaultValueif no value has been set.Examples:
String branchOffice = ivy.task.customFields().stringField("branchOffice").getOrDefault("Luzern");- Specified by:
getOrDefaultin interfaceICustomField<Number>- Parameters:
defaultValue- the value that is returned if no value has been set on the field- Returns:
- value or defaultValue if not value has been set
- See Also:
ICustomField.getOrNull(),ICustomField.get()- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
set
void set(Number value)
Sets the value of the field.
Set of
nullhas the same effect asICustomField.delete().Examples:
ivy.task.customFields().stringField("branchOffice").set("Zug");- Specified by:
setin interfaceICustomField<Number>- Parameters:
value- new value of the field- See Also:
ICustomField.compareAndSet(Object, Object),ICustomField.delete()- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
compareAndSet
boolean compareAndSet(Number expectedValue, Number newValue)
Sets the given
newValueif the current value of the field is equal to theexpectedValueotherwise the value is not set.This is an atomic operation. During the read of the current value and the set of the new value parallel transactions are blocked and cannot change the value in the meantime.
Setting of a
nullhas the same effect asICustomField.delete(). Expecting anullvalue means that thenewValueis only set if currently no value is set.Examples:
boolean successful = ivy.task.customFields().stringField("salesState").compareAndSet("FirstContact", "OfferSent");- Specified by:
compareAndSetin interfaceICustomField<Number>- Parameters:
expectedValue- the expected valuenewValue- the new value- Returns:
- true if the new value was set otherwise false
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
-