@Test public void testEquals() { new EqualsTester() .addEqualityGroup( PacketHeaderConstraints.unconstrained(), PacketHeaderConstraints.builder().build()) .addEqualityGroup(PacketHeaderConstraints.builder().setDstIp("1.1.1.1")) .addEqualityGroup( PacketHeaderConstraints.builder().setSrcIp("2.2.2.2").setDstIp("1.1.1.1").build()) .addEqualityGroup( PacketHeaderConstraints.builder() .setTcpFlags(Collections.singleton(TcpFlagsMatchConditions.ACK_TCP_FLAG)) .build()) .addEqualityGroup( PacketHeaderConstraints.builder() .setTcpFlags(Collections.singleton(TcpFlagsMatchConditions.SYN_ACK_TCP_FLAG)) .build()) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PacketHeaderConstraints)) { return false; } PacketHeaderConstraints that = (PacketHeaderConstraints) o; return Objects.equals(_dscps, that._dscps) && Objects.equals(_ecns, that._ecns) && Objects.equals(_packetLengths, that._packetLengths) && Objects.equals(_fragmentOffsets, that._fragmentOffsets) && Objects.equals(_ipProtocols, that._ipProtocols) && Objects.equals(_srcIp, that._srcIp) && Objects.equals(_dstIp, that._dstIp) && Objects.equals(_icmpCode, that._icmpCode) && Objects.equals(_icmpType, that._icmpType) && Objects.equals(_srcPorts, that._srcPorts) && Objects.equals(_dstPorts, that._dstPorts) && Objects.equals(_applications, that._applications) && Objects.equals(_tcpFlags, that._tcpFlags); }
PacketHeaderConstraints { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PacketHeaderConstraints)) { return false; } PacketHeaderConstraints that = (PacketHeaderConstraints) o; return Objects.equals(_dscps, that._dscps) && Objects.equals(_ecns, that._ecns) && Objects.equals(_packetLengths, that._packetLengths) && Objects.equals(_fragmentOffsets, that._fragmentOffsets) && Objects.equals(_ipProtocols, that._ipProtocols) && Objects.equals(_srcIp, that._srcIp) && Objects.equals(_dstIp, that._dstIp) && Objects.equals(_icmpCode, that._icmpCode) && Objects.equals(_icmpType, that._icmpType) && Objects.equals(_srcPorts, that._srcPorts) && Objects.equals(_dstPorts, that._dstPorts) && Objects.equals(_applications, that._applications) && Objects.equals(_tcpFlags, that._tcpFlags); } }
PacketHeaderConstraints { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PacketHeaderConstraints)) { return false; } PacketHeaderConstraints that = (PacketHeaderConstraints) o; return Objects.equals(_dscps, that._dscps) && Objects.equals(_ecns, that._ecns) && Objects.equals(_packetLengths, that._packetLengths) && Objects.equals(_fragmentOffsets, that._fragmentOffsets) && Objects.equals(_ipProtocols, that._ipProtocols) && Objects.equals(_srcIp, that._srcIp) && Objects.equals(_dstIp, that._dstIp) && Objects.equals(_icmpCode, that._icmpCode) && Objects.equals(_icmpType, that._icmpType) && Objects.equals(_srcPorts, that._srcPorts) && Objects.equals(_dstPorts, that._dstPorts) && Objects.equals(_applications, that._applications) && Objects.equals(_tcpFlags, that._tcpFlags); } private  PacketHeaderConstraints(
      @Nullable IntegerSpace dscps,
      @Nullable IntegerSpace ecns,
      @Nullable IntegerSpace packetLengths,
      @Nullable IntegerSpace fragmentOffsets,
      @Nullable Set<IpProtocol> ipProtocols,
      @Nullable String srcIp,
      @Nullable String dstIp,
      @Nullable IntegerSpace icmpCode,
      @Nullable IntegerSpace icmpType,
      @Nullable IntegerSpace srcPorts,
      @Nullable IntegerSpace dstPorts,
      @Nullable String applications,
      @Nullable Set<TcpFlagsMatchConditions> tcpFlags); }
PacketHeaderConstraints { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PacketHeaderConstraints)) { return false; } PacketHeaderConstraints that = (PacketHeaderConstraints) o; return Objects.equals(_dscps, that._dscps) && Objects.equals(_ecns, that._ecns) && Objects.equals(_packetLengths, that._packetLengths) && Objects.equals(_fragmentOffsets, that._fragmentOffsets) && Objects.equals(_ipProtocols, that._ipProtocols) && Objects.equals(_srcIp, that._srcIp) && Objects.equals(_dstIp, that._dstIp) && Objects.equals(_icmpCode, that._icmpCode) && Objects.equals(_icmpType, that._icmpType) && Objects.equals(_srcPorts, that._srcPorts) && Objects.equals(_dstPorts, that._dstPorts) && Objects.equals(_applications, that._applications) && Objects.equals(_tcpFlags, that._tcpFlags); } private  PacketHeaderConstraints(
      @Nullable IntegerSpace dscps,
      @Nullable IntegerSpace ecns,
      @Nullable IntegerSpace packetLengths,
      @Nullable IntegerSpace fragmentOffsets,
      @Nullable Set<IpProtocol> ipProtocols,
      @Nullable String srcIp,
      @Nullable String dstIp,
      @Nullable IntegerSpace icmpCode,
      @Nullable IntegerSpace icmpType,
      @Nullable IntegerSpace srcPorts,
      @Nullable IntegerSpace dstPorts,
      @Nullable String applications,
      @Nullable Set<TcpFlagsMatchConditions> tcpFlags); static PacketHeaderConstraints unconstrained(); @Nullable @JsonProperty(PROP_DSCPS) IntegerSpace getDscps(); @Nullable @JsonProperty(PROP_ECNS) IntegerSpace getEcns(); @Nullable @JsonProperty(PROP_PACKET_LENGTHS) IntegerSpace getPacketLengths(); @Nullable @JsonProperty(PROP_FRAGMENT_OFFSETS) IntegerSpace getFragmentOffsets(); @Nullable Set<IpProtocol> getIpProtocols(); @Nullable @JsonProperty(PROP_SRC_IPS) String getSrcIps(); @Nullable @JsonProperty(PROP_DST_IPS) String getDstIps(); @Nullable @JsonProperty(PROP_ICMP_CODES) IntegerSpace getIcmpCodes(); @Nullable @JsonProperty(PROP_ICMP_TYPES) IntegerSpace getIcmpTypes(); @Nullable @JsonProperty(PROP_SRC_PORTS) IntegerSpace getSrcPorts(); @Nullable @JsonProperty(PROP_DST_PORTS) IntegerSpace getDstPorts(); @JsonProperty(PROP_APPLICATIONS) @Nullable String getApplicationsString(); Set<Application> getApplications(); @Nullable @JsonProperty(PROP_TCP_FLAGS) Set<TcpFlagsMatchConditions> getTcpFlags(); @Nullable Set<IpProtocol> resolveIpProtocols(); @Nullable IntegerSpace resolveDstPorts(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder(); }
PacketHeaderConstraints { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PacketHeaderConstraints)) { return false; } PacketHeaderConstraints that = (PacketHeaderConstraints) o; return Objects.equals(_dscps, that._dscps) && Objects.equals(_ecns, that._ecns) && Objects.equals(_packetLengths, that._packetLengths) && Objects.equals(_fragmentOffsets, that._fragmentOffsets) && Objects.equals(_ipProtocols, that._ipProtocols) && Objects.equals(_srcIp, that._srcIp) && Objects.equals(_dstIp, that._dstIp) && Objects.equals(_icmpCode, that._icmpCode) && Objects.equals(_icmpType, that._icmpType) && Objects.equals(_srcPorts, that._srcPorts) && Objects.equals(_dstPorts, that._dstPorts) && Objects.equals(_applications, that._applications) && Objects.equals(_tcpFlags, that._tcpFlags); } private  PacketHeaderConstraints(
      @Nullable IntegerSpace dscps,
      @Nullable IntegerSpace ecns,
      @Nullable IntegerSpace packetLengths,
      @Nullable IntegerSpace fragmentOffsets,
      @Nullable Set<IpProtocol> ipProtocols,
      @Nullable String srcIp,
      @Nullable String dstIp,
      @Nullable IntegerSpace icmpCode,
      @Nullable IntegerSpace icmpType,
      @Nullable IntegerSpace srcPorts,
      @Nullable IntegerSpace dstPorts,
      @Nullable String applications,
      @Nullable Set<TcpFlagsMatchConditions> tcpFlags); static PacketHeaderConstraints unconstrained(); @Nullable @JsonProperty(PROP_DSCPS) IntegerSpace getDscps(); @Nullable @JsonProperty(PROP_ECNS) IntegerSpace getEcns(); @Nullable @JsonProperty(PROP_PACKET_LENGTHS) IntegerSpace getPacketLengths(); @Nullable @JsonProperty(PROP_FRAGMENT_OFFSETS) IntegerSpace getFragmentOffsets(); @Nullable Set<IpProtocol> getIpProtocols(); @Nullable @JsonProperty(PROP_SRC_IPS) String getSrcIps(); @Nullable @JsonProperty(PROP_DST_IPS) String getDstIps(); @Nullable @JsonProperty(PROP_ICMP_CODES) IntegerSpace getIcmpCodes(); @Nullable @JsonProperty(PROP_ICMP_TYPES) IntegerSpace getIcmpTypes(); @Nullable @JsonProperty(PROP_SRC_PORTS) IntegerSpace getSrcPorts(); @Nullable @JsonProperty(PROP_DST_PORTS) IntegerSpace getDstPorts(); @JsonProperty(PROP_APPLICATIONS) @Nullable String getApplicationsString(); Set<Application> getApplications(); @Nullable @JsonProperty(PROP_TCP_FLAGS) Set<TcpFlagsMatchConditions> getTcpFlags(); @Nullable Set<IpProtocol> resolveIpProtocols(); @Nullable IntegerSpace resolveDstPorts(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder();  }