Class GroupListing

java.lang.Object
org.apache.kafka.clients.admin.GroupListing

@Evolving public class GroupListing extends Object
A listing of a group in the cluster.
  • Constructor Details

    • GroupListing

      public GroupListing(String groupId, Optional<GroupType> type, String protocol, Optional<GroupState> groupState)
      Create an instance with the specified parameters.
      Parameters:
      groupId - Group Id
      type - Group type
      protocol - Protocol
      groupState - Group state
  • Method Details

    • groupId

      public String groupId()
      The group Id.
      Returns:
      Group Id
    • type

      public Optional<GroupType> type()
      The type of the group.

      If the broker returns a group type which is not recognised, as might happen when talking to a broker with a later version, the type will be Optional.of(GroupType.UNKNOWN). If the broker is earlier than version 2.6.0, the group type will not be available, and the type will be Optional.empty().

      Returns:
      An Optional containing the type, if available
    • protocol

      public String protocol()
      The protocol of the group.
      Returns:
      The protocol
    • groupState

      public Optional<GroupState> groupState()
      The group state.

      If the broker returns a group state which is not recognised, as might happen when talking to a broker with a later version, the state will be Optional.of(GroupState.UNKNOWN).

      Returns:
      An Optional containing the state, if available.
    • isSimpleConsumerGroup

      public boolean isSimpleConsumerGroup()
      If the group is a simple consumer group or not.
    • toString

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

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

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