@Test public void testEquals() throws Exception { assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST"), SxpBindingFilter.generateFilter(getAclFilter(FilterType.Inbound), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST"), SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST2")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter("basic-domain1"), "TEST"), SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST"), SxpBindingFilter.generateFilter(getPeerSequenceFilter("basic-domain"), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST"), SxpBindingFilter.generateFilter(getPrefixListFilter("basic-domain"), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter(FilterType.Inbound), "TEST2"), SxpBindingFilter.generateFilter(getAclFilter(FilterType.Inbound), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter(FilterType.Outbound), "TEST"), SxpBindingFilter.generateFilter(getAclFilter(FilterType.Inbound), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter(FilterType.Inbound), "TEST"), SxpBindingFilter.generateFilter(getPrefixListFilter(FilterType.Inbound), "TEST")); assertNotEquals(SxpBindingFilter.generateFilter(getAclFilter(FilterType.Inbound), "TEST"), SxpBindingFilter.generateFilter(getPeerSequenceFilter(FilterType.Inbound), "TEST")); assertEquals(SxpBindingFilter.generateFilter(getAclFilter(FilterType.Outbound), "TEST"), SxpBindingFilter.generateFilter(getAclFilter(FilterType.Outbound), "TEST")); assertEquals(SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST"), SxpBindingFilter.generateFilter(getAclFilter("basic-domain"), "TEST")); SxpBindingFilter<? extends FilterEntries, ? extends SxpFilterFields> defaultFilter = SxpBindingFilter.generateFilter(getAclFilter(FilterType.Outbound), "TEST"); assertEquals(defaultFilter, defaultFilter); assertFalse(defaultFilter.equals(null)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SxpBindingFilter that = (SxpBindingFilter) o; if (sxpFilter instanceof SxpDomainFilterFields && that.sxpFilter instanceof SxpDomainFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterSpecific(), ((SxpDomainFilterFields) that.sxpFilter).getFilterSpecific()) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterName(), ((SxpDomainFilterFields) that.sxpFilter).getFilterName()); } else if (sxpFilter instanceof SxpFilterFields && that.sxpFilter instanceof SxpFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpFilterFields) sxpFilter).getFilterType(), ((SxpFilterFields) that.sxpFilter).getFilterType()) && Objects.equals(((SxpFilterFields) sxpFilter).getFilterSpecific(), ((SxpFilterFields) that.sxpFilter).getFilterSpecific()); } return false; }
SxpBindingFilter implements Function<SxpBindingFields, Boolean>, Predicate<SxpBindingFields> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SxpBindingFilter that = (SxpBindingFilter) o; if (sxpFilter instanceof SxpDomainFilterFields && that.sxpFilter instanceof SxpDomainFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterSpecific(), ((SxpDomainFilterFields) that.sxpFilter).getFilterSpecific()) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterName(), ((SxpDomainFilterFields) that.sxpFilter).getFilterName()); } else if (sxpFilter instanceof SxpFilterFields && that.sxpFilter instanceof SxpFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpFilterFields) sxpFilter).getFilterType(), ((SxpFilterFields) that.sxpFilter).getFilterType()) && Objects.equals(((SxpFilterFields) sxpFilter).getFilterSpecific(), ((SxpFilterFields) that.sxpFilter).getFilterSpecific()); } return false; } }
SxpBindingFilter implements Function<SxpBindingFields, Boolean>, Predicate<SxpBindingFields> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SxpBindingFilter that = (SxpBindingFilter) o; if (sxpFilter instanceof SxpDomainFilterFields && that.sxpFilter instanceof SxpDomainFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterSpecific(), ((SxpDomainFilterFields) that.sxpFilter).getFilterSpecific()) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterName(), ((SxpDomainFilterFields) that.sxpFilter).getFilterName()); } else if (sxpFilter instanceof SxpFilterFields && that.sxpFilter instanceof SxpFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpFilterFields) sxpFilter).getFilterType(), ((SxpFilterFields) that.sxpFilter).getFilterType()) && Objects.equals(((SxpFilterFields) sxpFilter).getFilterSpecific(), ((SxpFilterFields) that.sxpFilter).getFilterSpecific()); } return false; } private  SxpBindingFilter(String identifier); protected  SxpBindingFilter(R filter, String identifier); }
SxpBindingFilter implements Function<SxpBindingFields, Boolean>, Predicate<SxpBindingFields> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SxpBindingFilter that = (SxpBindingFilter) o; if (sxpFilter instanceof SxpDomainFilterFields && that.sxpFilter instanceof SxpDomainFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterSpecific(), ((SxpDomainFilterFields) that.sxpFilter).getFilterSpecific()) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterName(), ((SxpDomainFilterFields) that.sxpFilter).getFilterName()); } else if (sxpFilter instanceof SxpFilterFields && that.sxpFilter instanceof SxpFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpFilterFields) sxpFilter).getFilterType(), ((SxpFilterFields) that.sxpFilter).getFilterType()) && Objects.equals(((SxpFilterFields) sxpFilter).getFilterSpecific(), ((SxpFilterFields) that.sxpFilter).getFilterSpecific()); } return false; } private  SxpBindingFilter(String identifier); protected  SxpBindingFilter(R filter, String identifier); R getSxpFilter(); String getIdentifier(); @Override Boolean apply(SxpBindingFields binding); @Override boolean test(SxpBindingFields binding); static SxpBindingFilter<?, ? extends SxpFilterFields> generateFilter(T filter,
            String peerGroupName); static SxpBindingFilter<?, ? extends SxpDomainFilterFields> generateFilter(
            T filter, String domainName); @Override boolean equals(Object o); @Override int hashCode(); static SxpBindingFilter<?, ? extends SxpFilterFields> mergeFilters(
            final Collection<SxpBindingFilter<?, ? extends SxpFilterFields>> values); static boolean checkInCompatibility(F filter1, F filter2); static SxpBindingFilter<?, ? extends SxpDomainFilterFields> mergeFilters(
            List<SxpBindingFilter<?, ? extends SxpDomainFilterFields>> values); }
SxpBindingFilter implements Function<SxpBindingFields, Boolean>, Predicate<SxpBindingFields> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SxpBindingFilter that = (SxpBindingFilter) o; if (sxpFilter instanceof SxpDomainFilterFields && that.sxpFilter instanceof SxpDomainFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterSpecific(), ((SxpDomainFilterFields) that.sxpFilter).getFilterSpecific()) && Objects.equals( ((SxpDomainFilterFields) sxpFilter).getFilterName(), ((SxpDomainFilterFields) that.sxpFilter).getFilterName()); } else if (sxpFilter instanceof SxpFilterFields && that.sxpFilter instanceof SxpFilterFields) { return Objects.equals(this.identifier, that.identifier) && Objects.equals( ((SxpFilterFields) sxpFilter).getFilterType(), ((SxpFilterFields) that.sxpFilter).getFilterType()) && Objects.equals(((SxpFilterFields) sxpFilter).getFilterSpecific(), ((SxpFilterFields) that.sxpFilter).getFilterSpecific()); } return false; } private  SxpBindingFilter(String identifier); protected  SxpBindingFilter(R filter, String identifier); R getSxpFilter(); String getIdentifier(); @Override Boolean apply(SxpBindingFields binding); @Override boolean test(SxpBindingFields binding); static SxpBindingFilter<?, ? extends SxpFilterFields> generateFilter(T filter,
            String peerGroupName); static SxpBindingFilter<?, ? extends SxpDomainFilterFields> generateFilter(
            T filter, String domainName); @Override boolean equals(Object o); @Override int hashCode(); static SxpBindingFilter<?, ? extends SxpFilterFields> mergeFilters(
            final Collection<SxpBindingFilter<?, ? extends SxpFilterFields>> values); static boolean checkInCompatibility(F filter1, F filter2); static SxpBindingFilter<?, ? extends SxpDomainFilterFields> mergeFilters(
            List<SxpBindingFilter<?, ? extends SxpDomainFilterFields>> values);  }