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

org.zodiac.sentinel.base.cluster.model.ClusterGroup Maven / Gradle / Ivy

package org.zodiac.sentinel.base.cluster.model;

import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

import org.zodiac.sdk.toolkit.util.collection.CollUtil;

public class ClusterGroup implements Serializable {

    private static final long serialVersionUID = -7084378797022715102L;

    private String machineId;
    private String ip;
    private Integer port;
    private Set clientSet = CollUtil.set();

    private Double maxAllowedQps;

    public ClusterGroup() {
        super();
    }

    public Double getMaxAllowedQps() {
        return maxAllowedQps;
    }

    public void setMaxAllowedQps(Double maxAllowedQps) {
        this.maxAllowedQps = maxAllowedQps;
    }

    public String getMachineId() {
        return machineId;
    }

    public ClusterGroup setMachineId(String machineId) {
        this.machineId = machineId;
        return this;
    }

    public String getIp() {
        return ip;
    }

    public ClusterGroup setIp(String ip) {
        this.ip = ip;
        return this;
    }

    public Integer getPort() {
        return port;
    }

    public ClusterGroup setPort(Integer port) {
        this.port = port;
        return this;
    }

    public Set getClientSet() {
        return clientSet;
    }

    public void setClientSet(Set clientSet) {
        this.clientSet = clientSet;
    }

    @Override
    public int hashCode() {
        return Objects.hash(clientSet, ip, machineId, maxAllowedQps, port);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        ClusterGroup other = (ClusterGroup)obj;
        return Objects.equals(clientSet, other.clientSet) && Objects.equals(ip, other.ip)
            && Objects.equals(machineId, other.machineId) && Objects.equals(maxAllowedQps, other.maxAllowedQps)
            && Objects.equals(port, other.port);
    }

    @Override
    public String toString() {
        return "ClusterGroup [machineId=" + machineId + ", ip=" + ip + ", port=" + port + ", clientSet=" + clientSet
            + ", maxAllowedQps=" + maxAllowedQps + "]";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy