@Override
    public boolean equals(Object obj)
    {
        if(this == obj)
            return true;
        
        if(!(obj instanceof Port))
            return false;
        
        Port that = (Port) obj;
        return (this.getSwitch() == null && that.getSwitch() == null || 
                this.getSwitch() != null && that.getSwitch() != null && 
                this.getSwitch()    .equals(that.getSwitch()))    && 
                this.getMACAddress().equals(that.getMACAddress()) &&
                this.getNumber() == that.getNumber();
    }