java.lang.Object
java.lang.Record
org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode

public record StatusCode(long value) extends Record
  • Field Details

  • Constructor Details

    • StatusCode

      public StatusCode(int value)
    • StatusCode

      public StatusCode(UInteger value)
    • StatusCode

      public StatusCode(long value)
      Creates an instance of a StatusCode record class.
      Parameters:
      value - the value for the value record component
  • Method Details

    • getValue

      public long getValue()
    • isGood

      public boolean isGood()
    • isBad

      public boolean isBad()
    • isUncertain

      public boolean isUncertain()
    • withDataValueInfoType

      public StatusCode withDataValueInfoType()
      Set the DataValue InfoType bits.
      Returns:
      a new StatusCode with DataValue InfoType bits set.
    • withoutDataValueInfoType

      public StatusCode withoutDataValueInfoType()
      Clear the DataValue InfoType bits.
      Returns:
      a new StatusCode with DataValue InfoType bits cleared.
    • withOverflow

      public StatusCode withOverflow()
      Set the DataValue InfoType and Overflow InfoBits.
      Returns:
      a new StatusCode DataValue and Overflow bits set.
    • withoutOverflow

      public StatusCode withoutOverflow()
      Clear the DataValue InfoType and Overflow InfoBits.
      Returns:
      a new StatusCode with DataValue and Overflow bits cleared.
    • isOverflowSet

      public boolean isOverflowSet()
      Returns:
      true if DataValue and Overflow bits are set.
    • isSecurityError

      public boolean isSecurityError()
      Returns:
      true if the StatusCode is considered security-related for the purpose of diagnostics.
    • getInfoType

      public StatusCode.InfoType getInfoType()
      Get the type of information contained in the info bits.
      Returns:
      the StatusCode.InfoType.
    • getDataValueInfoBits

      public Optional<StatusCode.DataValueInfoBits> getDataValueInfoBits()
      Returns:
      StatusCode.DataValueInfoBits if the StatusCode.InfoType is StatusCode.InfoType.DataValue.
    • toString

      public @NonNull String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • of

      public static StatusCode of(long value)
      Create a new StatusCode with the given value.
      Parameters:
      value - the value of the StatusCode.
      Returns:
      a new StatusCode.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • value

      public long value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component