Class ObjectReference

java.lang.Object
de.xima.fc.workflow.ObjectReference
All Implemented Interfaces:
IObjectReference, Serializable

public final class ObjectReference extends Object implements IObjectReference
A reference to an object (a concrete instance of a certain type of objects), consisting of the type of the objects and the unique identifier of the object within that type.
Since:
8.5.0
See Also:
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getId

      public String getId()
      Description copied from interface: IObjectReference
      Gets the ID of the identified object.
      Specified by:
      getId in interface IObjectReference
      Returns:
      The object ID.
    • getType

      public String getType()
      Description copied from interface: IObjectReference
      Gets the type of the identified objects. This should be the type name of an EntityType, if available, but may be another string in case no such entity type exists. Prefer IObjectReference.getTypeKnown() if applicable.
      Specified by:
      getType in interface IObjectReference
      Returns:
      The object type.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copyOf

      public static ObjectReference copyOf(IObjectReference value)
      Creates a copy of the given object reference with the same type and id.
      Parameters:
      value - The object reference to copy.
      Returns:
      The copied object reference.
    • of

      public static ObjectReference of(String type, String id)
      Creates a new object reference of the given type and id.
      Parameters:
      type - The type of the object. Must have a toString() method that returns a unique string representation.
      id - The identifier for the object of that type. Must have a toString() method that returns a unique string representation.
      Returns:
      The object reference.
    • ofKnown

      public static ObjectReference ofKnown(EntityType type, String id)
      Creates a new object reference of the given type and id.
      Parameters:
      type - The type of the object. Must have a toString() method that returns a unique string representation.
      id - The identifier for the object of that type. Must have a toString() method that returns a unique string representation.
      Returns:
      The object reference.
    • valueOf

      public static ObjectReference valueOf(String value)
      Parses an object reference from its string representation, as returned by toString().
      Parameters:
      value - The string representation.
      Returns:
      The object reference, or null if the string is null or blank.
      Throws:
      IllegalArgumentException - If the string is not in the correct format.