Class IDValue

java.lang.Object
com.isode.dsapi.profile.IDValue

public class IDValue extends Object
Class for managing a unique id value
Since:
17.0
Author:
ac
  • Constructor Details

    • IDValue

      public IDValue()
      Constructor for IDValue with unset.
    • IDValue

      public IDValue(String value)
      Creates a IDValue with the given id value.
      Parameters:
      value - The id value to set, if null the IDValue will be created with no id
  • Method Details

    • getIDIfSet

      public Optional<String> getIDIfSet()
      Gets the id if it is set.
      Returns:
      An Optional containing the id if it is set, otherwise an empty Optional
    • getIDAndGenerate

      public String getIDAndGenerate()
      Gets the id if it is set, if it is not set generates one and then returns it.
      Returns:
      The set id, or a newly generated id if it was not set.
    • isIDSet

      public boolean isIDSet()
      Indicates if an id value is set.
      Returns:
      true if an id value is set.
    • idEquals

      public boolean idEquals(String value)
      Indicates if the ID value is equal to the given value.
      Parameters:
      value - A value to check against, if null value will be false.
      Returns:
      true if id is set and equals the given value, otherwise false