package org.kne.cloud.network.tun;

import java.net.InetAddress;

public class InetAddressRow {
	private InetAddress address;
	private int perfix;
	public InetAddressRow(InetAddress address, int perfix) {
		super();
		this.address = address;
		this.perfix = perfix;
	}
	public InetAddress getAddress() {
		return address;
	}
	public int getPerfix() {
		return perfix;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + perfix;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		InetAddressRow other = (InetAddressRow) obj;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (perfix != other.perfix)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "InetAddressRow [address=" + address + ", perfix=" + perfix + "]";
	}
	
}
