Record Class LeaderStatus

java.lang.Object
java.lang.Record
codes.grow.packages.openbao.LeaderStatus
Record Components:
haEnabled - whether high availability is enabled
isSelf - whether this node is the leader
activeTime - when the leader became active
leaderAddress - leader API address
leaderClusterAddress - leader cluster address

public record LeaderStatus(boolean haEnabled, boolean isSelf, Optional<Instant> activeTime, String leaderAddress, String leaderClusterAddress) extends Record
Leader status (GET sys/leader).
  • Constructor Details

    • LeaderStatus

      public LeaderStatus(boolean haEnabled, boolean isSelf, Optional<Instant> activeTime, String leaderAddress, String leaderClusterAddress)
      Creates an instance of a LeaderStatus record class.
      Parameters:
      haEnabled - the value for the haEnabled record component
      isSelf - the value for the isSelf record component
      activeTime - the value for the activeTime record component
      leaderAddress - the value for the leaderAddress record component
      leaderClusterAddress - the value for the leaderClusterAddress record component
  • Method Details

    • toString

      public final 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
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • haEnabled

      public boolean haEnabled()
      Returns the value of the haEnabled record component.
      Returns:
      the value of the haEnabled record component
    • isSelf

      public boolean isSelf()
      Returns the value of the isSelf record component.
      Returns:
      the value of the isSelf record component
    • activeTime

      public Optional<Instant> activeTime()
      Returns the value of the activeTime record component.
      Returns:
      the value of the activeTime record component
    • leaderAddress

      public String leaderAddress()
      Returns the value of the leaderAddress record component.
      Returns:
      the value of the leaderAddress record component
    • leaderClusterAddress

      public String leaderClusterAddress()
      Returns the value of the leaderClusterAddress record component.
      Returns:
      the value of the leaderClusterAddress record component