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:
API:
This is a public API.
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns:
      true if 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 range
      NumberFormatException - if part cannot be converted to number
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.