/** * Compares this filter to the specified object. Returns true if the passed in object is the * same as this filter. Checks to make sure the filter types, the value, and the pattern are the * same. & * * @param obj - the object to compare this LikeFilter against. * @return true if specified object is equal to this filter; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof LikeFilterImpl) { LikeFilterImpl lFilter = (LikeFilterImpl) obj; // REVISIT: check for nulls. return ((Filters.getFilterType(lFilter) == Filters.getFilterType(this)) && lFilter.getExpression().equals(this.attribute) && lFilter.getPattern().equals(this.pattern)); } return false; }
AttributeExpressionImpl impl = (AttributeExpressionImpl) likeFilter.getExpression(); String attribute = impl.getPropertyName(); String value = likeFilter.getLiteral();
/** * Compares this filter to the specified object. Returns true if the passed in object is the same as this filter. * Checks to make sure the filter types, the value, and the pattern are the same. * * @param obj * - the object to compare this LikeFilter against. * * @return true if specified object is equal to this filter; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof LikeFilterImpl) { LikeFilterImpl lFilter = (LikeFilterImpl) obj; // REVISIT: check for nulls. return ((Filters.getFilterType(lFilter) == Filters.getFilterType(this)) && lFilter.getExpression().equals(this.attribute) && lFilter.getPattern().equals(this.pattern)); } return false; }