@Test public void testEquals() { new EqualsTester() .addEqualityGroup( EXPR, EXPR, new CommunityMatchRegex(IntegerValueRendering.instance(), "a")) .addEqualityGroup(new CommunityMatchRegex(ColonSeparatedRendering.instance(), "a")) .addEqualityGroup(new CommunityMatchRegex(ColonSeparatedRendering.instance(), "b")) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommunityMatchRegex)) { return false; } CommunityMatchRegex rhs = (CommunityMatchRegex) obj; return _communityRendering.equals(rhs._communityRendering) && _regex.equals(rhs._regex); }
CommunityMatchRegex extends CommunityMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommunityMatchRegex)) { return false; } CommunityMatchRegex rhs = (CommunityMatchRegex) obj; return _communityRendering.equals(rhs._communityRendering) && _regex.equals(rhs._regex); } }
CommunityMatchRegex extends CommunityMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommunityMatchRegex)) { return false; } CommunityMatchRegex rhs = (CommunityMatchRegex) obj; return _communityRendering.equals(rhs._communityRendering) && _regex.equals(rhs._regex); } CommunityMatchRegex(CommunityRendering communityRendering, String regex); }
CommunityMatchRegex extends CommunityMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommunityMatchRegex)) { return false; } CommunityMatchRegex rhs = (CommunityMatchRegex) obj; return _communityRendering.equals(rhs._communityRendering) && _regex.equals(rhs._regex); } CommunityMatchRegex(CommunityRendering communityRendering, String regex); @JsonProperty(PROP_COMMUNITY_RENDERING) @Nonnull CommunityRendering getCommunityRendering(); @JsonProperty(PROP_REGEX) @Nonnull String getRegex(); @Override boolean equals(Object obj); @Override int hashCode(); @Override T accept(CommunityMatchExprVisitor<T, U> visitor, U arg); }
CommunityMatchRegex extends CommunityMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommunityMatchRegex)) { return false; } CommunityMatchRegex rhs = (CommunityMatchRegex) obj; return _communityRendering.equals(rhs._communityRendering) && _regex.equals(rhs._regex); } CommunityMatchRegex(CommunityRendering communityRendering, String regex); @JsonProperty(PROP_COMMUNITY_RENDERING) @Nonnull CommunityRendering getCommunityRendering(); @JsonProperty(PROP_REGEX) @Nonnull String getRegex(); @Override boolean equals(Object obj); @Override int hashCode(); @Override T accept(CommunityMatchExprVisitor<T, U> visitor, U arg);  }