com.taosdata.jdbc.common

## Class Cluster

- java.lang.Object
- - com.taosdata.jdbc.common.Cluster

    public class Cluster
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`Cluster(Endpoint... endpoints)` Constructs a Cluster with variable endpoints.
`Cluster(Set<Endpoint> endpoints)` Constructs a Cluster with a set of endpoints.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)` Checks equality: two clusters are equal if they contain exactly the same endpoints (order-agnostic).
`Set<Endpoint>` `getEndpoints()` Gets all nodes in the cluster (unmodifiable).
`int` `hashCode()` Generates hash code based on the endpoint set.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Cluster

    public Cluster(Endpoint... endpoints)

Constructs a Cluster with variable endpoints.

Parameters:
  `endpoints` - the nodes that form the cluster

#### Cluster

    public Cluster(Set<Endpoint> endpoints)

Constructs a Cluster with a set of endpoints.

Parameters:
  `endpoints` - the nodes that form the cluster

### Method Detail

#### getEndpoints

    public Set<Endpoint> getEndpoints()

Gets all nodes in the cluster (unmodifiable).

Returns:
  an immutable set of endpoints

#### equals

    public boolean equals(Object o)

Checks equality: two clusters are equal if they contain exactly the same endpoints (order-agnostic).

Overrides:
  `equals` in class `Object`
Parameters:
  `o` - the object to compare
Returns:
  true if endpoint sets are identical

#### hashCode

    public int hashCode()

Generates hash code based on the endpoint set.

Overrides:
  `hashCode` in class `Object`
Returns:
  the hash code

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`