@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (getClass() != obj.getClass()) { return false; } NetworkRule other = (NetworkRule) obj; if (this.highPort == null) { if (other.highPort != null) { return false; } } else if (!this.highPort.equals(other.highPort)) { return false; } if (this.ipRanges == null) { if (other.ipRanges != null) { return false; } } else if (!this.ipRanges.equals(other.ipRanges)) { return false; } if (this.lowPort == null) { if (other.lowPort != null) { return false; } } else if (!this.lowPort.equals(other.lowPort)) { return false; } if (this.networkPeers == null) { if (other.networkPeers != null) { return false; } } else if (!this.networkPeers.equals(other.networkPeers)) { return false; } if (this.protocol != other.protocol) { return false; } if (this.protocolNumber == null) { if (other.protocolNumber != null) { return false; } } else if (!this.protocolNumber.equals(other.protocolNumber)) { return false; } if (this.isEgress() != other.isEgress()) { return false; } return true; }
@Override public boolean apply(@Nullable final NetworkRule networkRule) { return networkRule != null && networkRule.isEgress(); }