All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.hotrod.impl.ClientTopology Maven / Gradle / Ivy

The newest version!
package org.infinispan.hotrod.impl;

import java.util.Objects;

import org.infinispan.hotrod.configuration.ClientIntelligence;

/**
 * Keeps the Hot Rod client topology information together: topology id and client intelligence.
 *
 * @since 14.0
 */
public final class ClientTopology {

   private final int topologyId;
   private final ClientIntelligence clientIntelligence;

   public ClientTopology(int topologyId, ClientIntelligence clientIntelligence) {
      this.topologyId = topologyId;
      this.clientIntelligence = Objects.requireNonNull(clientIntelligence);
   }

   public int getTopologyId() {
      return topologyId;
   }

   public ClientIntelligence getClientIntelligence() {
      return clientIntelligence;
   }

   @Override
   public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      ClientTopology that = (ClientTopology) o;

      return topologyId == that.topologyId && clientIntelligence == that.clientIntelligence;
   }

   @Override
   public int hashCode() {
      int result = topologyId;
      result = 31 * result + clientIntelligence.hashCode();
      return result;
   }

   @Override
   public String toString() {
      return "ClientTopology{" +
            "topologyId=" + topologyId +
            ", clientIntelligence=" + clientIntelligence +
            '}';
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy