@Test public void testEquals() { final String name = "FlowClassifier1"; final String description = "FlowClassifier1"; final String ethType = "IPv4"; final String protocol = "tcp"; final int priority = 65535; final int minSrcPortRange = 5; final int maxSrcPortRange = 10; final int minDstPortRange = 5; final int maxDstPortRange = 10; final FlowClassifierId flowClassifierId = FlowClassifierId.of("78dcd363-fc23-aeb6-f44b-56dc5e2fb3ae"); final TenantId tenantId = TenantId.tenantId("1"); final IpPrefix srcIpPrefix = IpPrefix.valueOf("0.0.0.0/0"); final IpPrefix dstIpPrefix = IpPrefix.valueOf("10.10.10.10/0"); final VirtualPortId virtualSrcPort = VirtualPortId.portId("1"); final VirtualPortId virtualDstPort = VirtualPortId.portId("2"); DefaultFlowClassifier.Builder flowClassifierBuilder = new DefaultFlowClassifier.Builder(); final FlowClassifier flowClassifier1 = flowClassifierBuilder.setFlowClassifierId(flowClassifierId) .setTenantId(tenantId).setName(name).setDescription(description).setEtherType(ethType) .setProtocol(protocol).setPriority(priority).setMinSrcPortRange(minSrcPortRange) .setMaxSrcPortRange(maxSrcPortRange).setMinDstPortRange(minDstPortRange) .setMaxDstPortRange(maxDstPortRange).setSrcIpPrefix(srcIpPrefix).setDstIpPrefix(dstIpPrefix) .setSrcPort(virtualSrcPort).setDstPort(virtualDstPort).build(); flowClassifierBuilder = new DefaultFlowClassifier.Builder(); final FlowClassifier sameAsFlowClassifier1 = flowClassifierBuilder.setFlowClassifierId(flowClassifierId) .setTenantId(tenantId).setName(name).setDescription(description).setEtherType(ethType) .setProtocol(protocol).setPriority(priority).setMinSrcPortRange(minSrcPortRange) .setMaxSrcPortRange(maxSrcPortRange).setMinDstPortRange(minDstPortRange) .setMaxDstPortRange(maxDstPortRange).setSrcIpPrefix(srcIpPrefix).setDstIpPrefix(dstIpPrefix) .setSrcPort(virtualSrcPort).setDstPort(virtualDstPort).build(); final String name2 = "FlowClassifier2"; final String description2 = "FlowClassifier2"; final String ethType2 = "IPv6"; final String protocol2 = "udp"; final int priority2 = 50000; final int minSrcPortRange2 = 5; final int maxSrcPortRange2 = 10; final int minDstPortRange2 = 5; final int maxDstPortRange2 = 10; final FlowClassifierId flowClassifierId2 = FlowClassifierId.of("78dcd363-fc23-aeb6-f44b-56dc5e2fb3ae"); final TenantId tenantId2 = TenantId.tenantId("2"); final IpPrefix srcIpPrefix2 = IpPrefix.valueOf("0.0.0.0/0"); final IpPrefix dstIpPrefix2 = IpPrefix.valueOf("10.10.10.10/0"); final VirtualPortId virtualSrcPort2 = VirtualPortId.portId("3"); final VirtualPortId virtualDstPort2 = VirtualPortId.portId("4"); DefaultFlowClassifier.Builder flowClassifierBuilder3 = new DefaultFlowClassifier.Builder(); final FlowClassifier flowClassifier2 = flowClassifierBuilder3.setFlowClassifierId(flowClassifierId2) .setTenantId(tenantId2).setName(name2).setDescription(description2).setEtherType(ethType2) .setProtocol(protocol2).setMinSrcPortRange(minSrcPortRange2).setMaxSrcPortRange(maxSrcPortRange2) .setMinDstPortRange(minDstPortRange2).setMaxDstPortRange(maxDstPortRange2).setSrcIpPrefix(srcIpPrefix2) .setDstIpPrefix(dstIpPrefix2).setSrcPort(virtualSrcPort2).setDstPort(virtualDstPort2) .setPriority(priority2).build(); new EqualsTester().addEqualityGroup(flowClassifier1, sameAsFlowClassifier1).addEqualityGroup(flowClassifier2) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultFlowClassifier) { DefaultFlowClassifier other = (DefaultFlowClassifier) obj; return Objects.equals(this.flowClassifierId, other.flowClassifierId) && Objects.equals(this.tenantId, other.tenantId) && Objects.equals(this.name, other.name) && Objects.equals(this.description, other.description) && Objects.equals(this.etherType, other.etherType) && Objects.equals(this.protocol, other.protocol) && Objects.equals(this.priority, other.priority) && Objects.equals(this.minSrcPortRange, other.minSrcPortRange) && Objects.equals(this.maxSrcPortRange, other.maxSrcPortRange) && Objects.equals(this.minDstPortRange, other.minDstPortRange) && Objects.equals(this.maxDstPortRange, other.maxDstPortRange) && Objects.equals(this.srcIpPrefix, other.srcIpPrefix) && Objects.equals(this.dstIpPrefix, other.dstIpPrefix) && Objects.equals(this.srcPort, other.srcPort) && Objects.equals(this.dstPort, other.dstPort); } return false; }
DefaultFlowClassifier implements FlowClassifier { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultFlowClassifier) { DefaultFlowClassifier other = (DefaultFlowClassifier) obj; return Objects.equals(this.flowClassifierId, other.flowClassifierId) && Objects.equals(this.tenantId, other.tenantId) && Objects.equals(this.name, other.name) && Objects.equals(this.description, other.description) && Objects.equals(this.etherType, other.etherType) && Objects.equals(this.protocol, other.protocol) && Objects.equals(this.priority, other.priority) && Objects.equals(this.minSrcPortRange, other.minSrcPortRange) && Objects.equals(this.maxSrcPortRange, other.maxSrcPortRange) && Objects.equals(this.minDstPortRange, other.minDstPortRange) && Objects.equals(this.maxDstPortRange, other.maxDstPortRange) && Objects.equals(this.srcIpPrefix, other.srcIpPrefix) && Objects.equals(this.dstIpPrefix, other.dstIpPrefix) && Objects.equals(this.srcPort, other.srcPort) && Objects.equals(this.dstPort, other.dstPort); } return false; } }
DefaultFlowClassifier implements FlowClassifier { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultFlowClassifier) { DefaultFlowClassifier other = (DefaultFlowClassifier) obj; return Objects.equals(this.flowClassifierId, other.flowClassifierId) && Objects.equals(this.tenantId, other.tenantId) && Objects.equals(this.name, other.name) && Objects.equals(this.description, other.description) && Objects.equals(this.etherType, other.etherType) && Objects.equals(this.protocol, other.protocol) && Objects.equals(this.priority, other.priority) && Objects.equals(this.minSrcPortRange, other.minSrcPortRange) && Objects.equals(this.maxSrcPortRange, other.maxSrcPortRange) && Objects.equals(this.minDstPortRange, other.minDstPortRange) && Objects.equals(this.maxDstPortRange, other.maxDstPortRange) && Objects.equals(this.srcIpPrefix, other.srcIpPrefix) && Objects.equals(this.dstIpPrefix, other.dstIpPrefix) && Objects.equals(this.srcPort, other.srcPort) && Objects.equals(this.dstPort, other.dstPort); } return false; } private  DefaultFlowClassifier(FlowClassifierId flowClassifierId, TenantId tenantId, String name,
                                  String description, String etherType, String protocol, int priority,
                                  int minSrcPortRange, int maxSrcPortRange, int minDstPortRange, int maxDstPortRange,
                                  IpPrefix srcIpPrefix, IpPrefix dstIpPrefix, VirtualPortId srcPort,
                                  VirtualPortId dstPort); }
DefaultFlowClassifier implements FlowClassifier { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultFlowClassifier) { DefaultFlowClassifier other = (DefaultFlowClassifier) obj; return Objects.equals(this.flowClassifierId, other.flowClassifierId) && Objects.equals(this.tenantId, other.tenantId) && Objects.equals(this.name, other.name) && Objects.equals(this.description, other.description) && Objects.equals(this.etherType, other.etherType) && Objects.equals(this.protocol, other.protocol) && Objects.equals(this.priority, other.priority) && Objects.equals(this.minSrcPortRange, other.minSrcPortRange) && Objects.equals(this.maxSrcPortRange, other.maxSrcPortRange) && Objects.equals(this.minDstPortRange, other.minDstPortRange) && Objects.equals(this.maxDstPortRange, other.maxDstPortRange) && Objects.equals(this.srcIpPrefix, other.srcIpPrefix) && Objects.equals(this.dstIpPrefix, other.dstIpPrefix) && Objects.equals(this.srcPort, other.srcPort) && Objects.equals(this.dstPort, other.dstPort); } return false; } private  DefaultFlowClassifier(FlowClassifierId flowClassifierId, TenantId tenantId, String name,
                                  String description, String etherType, String protocol, int priority,
                                  int minSrcPortRange, int maxSrcPortRange, int minDstPortRange, int maxDstPortRange,
                                  IpPrefix srcIpPrefix, IpPrefix dstIpPrefix, VirtualPortId srcPort,
                                  VirtualPortId dstPort); @Override FlowClassifierId flowClassifierId(); @Override TenantId tenantId(); @Override String name(); @Override String description(); @Override String etherType(); @Override String protocol(); @Override int priority(); @Override int minSrcPortRange(); @Override int maxSrcPortRange(); @Override int minDstPortRange(); @Override int maxDstPortRange(); @Override IpPrefix srcIpPrefix(); @Override IpPrefix dstIpPrefix(); @Override VirtualPortId srcPort(); @Override VirtualPortId dstPort(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean exactMatch(FlowClassifier flowClassifier); @Override String toString(); }
DefaultFlowClassifier implements FlowClassifier { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultFlowClassifier) { DefaultFlowClassifier other = (DefaultFlowClassifier) obj; return Objects.equals(this.flowClassifierId, other.flowClassifierId) && Objects.equals(this.tenantId, other.tenantId) && Objects.equals(this.name, other.name) && Objects.equals(this.description, other.description) && Objects.equals(this.etherType, other.etherType) && Objects.equals(this.protocol, other.protocol) && Objects.equals(this.priority, other.priority) && Objects.equals(this.minSrcPortRange, other.minSrcPortRange) && Objects.equals(this.maxSrcPortRange, other.maxSrcPortRange) && Objects.equals(this.minDstPortRange, other.minDstPortRange) && Objects.equals(this.maxDstPortRange, other.maxDstPortRange) && Objects.equals(this.srcIpPrefix, other.srcIpPrefix) && Objects.equals(this.dstIpPrefix, other.dstIpPrefix) && Objects.equals(this.srcPort, other.srcPort) && Objects.equals(this.dstPort, other.dstPort); } return false; } private  DefaultFlowClassifier(FlowClassifierId flowClassifierId, TenantId tenantId, String name,
                                  String description, String etherType, String protocol, int priority,
                                  int minSrcPortRange, int maxSrcPortRange, int minDstPortRange, int maxDstPortRange,
                                  IpPrefix srcIpPrefix, IpPrefix dstIpPrefix, VirtualPortId srcPort,
                                  VirtualPortId dstPort); @Override FlowClassifierId flowClassifierId(); @Override TenantId tenantId(); @Override String name(); @Override String description(); @Override String etherType(); @Override String protocol(); @Override int priority(); @Override int minSrcPortRange(); @Override int maxSrcPortRange(); @Override int minDstPortRange(); @Override int maxDstPortRange(); @Override IpPrefix srcIpPrefix(); @Override IpPrefix dstIpPrefix(); @Override VirtualPortId srcPort(); @Override VirtualPortId dstPort(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean exactMatch(FlowClassifier flowClassifier); @Override String toString();  }