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

Alachisoft.NCache.Common.DataStructures.PartNodeInfo Maven / Gradle / Ivy

package Alachisoft.NCache.Common.DataStructures;

import Alachisoft.NCache.Common.Net.Address;


public class PartNodeInfo {
    private Address _address;
    private String _subGroupId;
    private boolean _isCoordinator;
    private int _priorityIndex;

    public PartNodeInfo() {
        _address = new Address();
        _subGroupId = "";
        _isCoordinator = false;
        _priorityIndex = -1;
    }

    public PartNodeInfo(Address address, String subGroup, boolean isCoordinator) {
        _address = address;
        _subGroupId = subGroup;
        _isCoordinator = isCoordinator;
    }


    public final Address getNodeAddress() {
        return _address;
    }

    public final void setNodeAddress(Address value) {
        _address = value;
    }

    public final String getSubGroup() {
        return _subGroupId;
    }

    public final void setSubGroup(String value) {
        _subGroupId = value;
    }

    public final boolean getIsCoordinator() {
        return _isCoordinator;
    }

    public final void setIsCoordinator(boolean value) {
        _isCoordinator = value;
    }

    public final int getPriorityIndex() {
        return _priorityIndex;
    }

    public final void setPriorityIndex(int value) {
        _priorityIndex = value;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof PartNodeInfo) {
            PartNodeInfo other = (PartNodeInfo) obj;
            if ((this.getNodeAddress().equals(other.getNodeAddress())) && this._subGroupId.equals(other._subGroupId)) {
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        return "PartNodeInfo(" + getNodeAddress().toString() + ", " + getSubGroup() + "," + (new Boolean(getIsCoordinator())).toString() + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy