Class EventCode<T extends EventCode<T>>
- java.lang.Object
-
- ch.ivyteam.ivy.model.SimpleValueObject<String>
-
- ch.ivyteam.ivy.process.model.value.EventCode<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,Comparable<T>
- Direct Known Subclasses:
SignalCode
public abstract class EventCode<T extends EventCode<T>> extends SimpleValueObject<String> implements Comparable<T>
A common base class for representing codes divided by colons (:).
Example:user:created- Since:
- 6.1.0
- See Also:
- Serialized Form
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tappend(String part)Append the given part to the codeTappend(T part)Append the given part to the codeintcountParts()Counts the parts of a code.StringgetPart(int pos)Gets a part of the code.longgetPartAsNumber(int pos)Gets a part of the code as numberbooleanisEmpty()-
Methods inherited from class ch.ivyteam.ivy.model.SimpleValueObject
equals, hashCode, toString
-
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
- Returns:
trueif code is empty- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
append
public T append(String part)
Append the given part to the code- Parameters:
part-- Returns:
- the newly created code
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
append
public T append(T part)
Append the given part to the code- Parameters:
part-- Returns:
- the newly created code
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
countParts
public int countParts()
Counts the parts of a code.
Example:
import ch.ivyteam.ivy.process.model.value.SignalCode; Number count = new SignalCode("user:created:33").countParts(); // count is 3- Returns:
- the number of parts
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getPart
public String getPart(int pos)
Gets a part of the code.
Example:
import ch.ivyteam.ivy.process.model.value.SignalCode; String part = new SignalCode("user:created").getPart(1); // part is "created"- Parameters:
pos- The position of the part that is requested. Counting starts with 0.- Returns:
- The requested part
- Throws:
IllegalArgumentException- if position is not in range- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getPartAsNumber
public long getPartAsNumber(int pos)
Gets a part of the code as number
Example:
import ch.ivyteam.ivy.process.model.value.SignalCode; Number num = new SignalCode("signal:code:42").getPartAsNumber(2); // num is 42- Parameters:
pos- The position of the part that is requested. Counting starts with 0.- Returns:
- The requested part as number
- Throws:
IllegalArgumentException- if position is not in rangeNumberFormatException- if part cannot be converted to number- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
-