@Test public void testEquals() { CommunityVar cv = CommunityVar.from(StandardCommunity.of(1, 1)); new EqualsTester() .addEqualityGroup(cv, cv, CommunityVar.from(StandardCommunity.of(1, 1))) .addEqualityGroup(CommunityVar.from("1:1")) .addEqualityGroup(CommunityVar.other("1:1")) .addEqualityGroup(CommunityVar.from(StandardCommunity.of(1, 2))) .addEqualityGroup(CommunityVar.from("1:2")) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof CommunityVar)) { return false; } CommunityVar that = (CommunityVar) o; return _type == that._type && _regex.equals(that._regex) && Objects.equals(_literalValue, that._literalValue); }
CommunityVar extends SymbolicRegex implements Comparable<CommunityVar> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof CommunityVar)) { return false; } CommunityVar that = (CommunityVar) o; return _type == that._type && _regex.equals(that._regex) && Objects.equals(_literalValue, that._literalValue); } }
CommunityVar extends SymbolicRegex implements Comparable<CommunityVar> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof CommunityVar)) { return false; } CommunityVar that = (CommunityVar) o; return _type == that._type && _regex.equals(that._regex) && Objects.equals(_literalValue, that._literalValue); } private  CommunityVar(Type type, String regex, @Nullable Community literalValue); }
CommunityVar extends SymbolicRegex implements Comparable<CommunityVar> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof CommunityVar)) { return false; } CommunityVar that = (CommunityVar) o; return _type == that._type && _regex.equals(that._regex) && Objects.equals(_literalValue, that._literalValue); } private  CommunityVar(Type type, String regex, @Nullable Community literalValue); static CommunityVar from(String regex); static CommunityVar from(Community literalCommunity); static CommunityVar other(String regex); @Nonnull Type getType(); @Nullable Community getLiteralValue(); @Override Automaton toAutomaton(); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(CommunityVar that); }
CommunityVar extends SymbolicRegex implements Comparable<CommunityVar> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof CommunityVar)) { return false; } CommunityVar that = (CommunityVar) o; return _type == that._type && _regex.equals(that._regex) && Objects.equals(_literalValue, that._literalValue); } private  CommunityVar(Type type, String regex, @Nullable Community literalValue); static CommunityVar from(String regex); static CommunityVar from(Community literalCommunity); static CommunityVar other(String regex); @Nonnull Type getType(); @Nullable Community getLiteralValue(); @Override Automaton toAutomaton(); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(CommunityVar that); static final CommunityVar ALL_COMMUNITIES; }