package org.kne.cloud.network.ipv6;

import java.net.Inet6Address;
import java.net.InetAddress;
import java.util.Objects;

import org.kne.cloud.network.monitor.MonitorData;
import org.kne.cloud.network.te.BandwidthDistributer;

public class Neighbor {
	private IPv6AddressGroup address;
	private IPv6AddressGroup locator;
	private MonitorData monitor;
	private BandwidthDistributer<Inet6Address> bandwidthDistributer;
	public MonitorData getMonitor() {
		return monitor;
	}
	public IPv6AddressGroup getAddress() {
		return address;
	}
	public IPv6AddressGroup getLocator() {
		return locator;
	}
	
	public BandwidthDistributer<Inet6Address> getBandwidthDistributer() {
		return bandwidthDistributer;
	}
	public Neighbor(IPv6AddressGroup address, IPv6AddressGroup locator, MonitorData monitor) {
		super();
		this.address = address;
		this.locator = locator;
		this.monitor = monitor;
	}
	public Neighbor(IPv6AddressGroup address, IPv6AddressGroup locator, MonitorData monitor2,
			BandwidthDistributer<Inet6Address> bandwidthDistributer) {
		this(address,locator,monitor2);
		this.bandwidthDistributer=bandwidthDistributer;
	}
	@Override
	public String toString() {
		return "Neighbor [address=" + address + ", locator=" + locator + ", monitor=" + monitor + "]";
	}
	@Override
	public int hashCode() {
		return Objects.hash(address, locator);
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Neighbor other = (Neighbor) obj;
		return Objects.equals(address, other.address) && Objects.equals(locator, other.locator);
	}
	
}
