- Type Parameters:
R
- the type of resources (e.g.Feature
) to filter.
- All Superinterfaces:
ComparisonOperator<R>
,Filter<R>
,Predicate<R>
@UML(identifier="LikeOperator",
specification=ISO_19143)
public interface LikeOperator<R>
extends ComparisonOperator<R>
A character string comparison operator with pattern matching.
LikeOperator
performs the equivalent of the SQL "LIKE
" operator on properties of a feature.
The pattern contains a combination of regular characters, the wildcard character,
the single character, and the escape character.
The wildcard character matches zero or more characters.
The single character matches exactly one character.
The escape character is used to escape the meaning of the wildcard, single character and escape character itself.- Since:
- 3.1
-
Method Summary
Modifier and TypeMethodDescriptiondefault char
Returns the character that can be used in the pattern to prefix one of the wild card characters to indicate that it should be matched literally in the content of the feature's property.List
<Expression<R, ?>> Returns the expression whose values will be compared by this operator, together with the pattern.default ComparisonOperatorName
Returns the nature of the comparison.default char
Returns the character that can be used in the pattern to match exactly one character.default char
Returns the character that can be used in the pattern to match any sequence of characters.default boolean
Specifies how a filter expression processor should perform string comparisons.Methods inherited from interface org.opengis.filter.Filter
getResourceClass, test
-
Method Details
-
getOperatorType
Returns the nature of the comparison. The default implementation returnsPROPERTY_IS_LIKE
.- Specified by:
getOperatorType
in interfaceComparisonOperator<R>
- Specified by:
getOperatorType
in interfaceFilter<R>
- Returns:
- the nature of the comparison.
-
getExpressions
@UML(identifier="expression", obligation=MANDATORY, specification=ISO_19143) List<Expression<R,?>> getExpressions()Returns the expression whose values will be compared by this operator, together with the pattern. The list content is as below:- The first expression provides the values to compare. It should evaluate to a character string.
- The second expression is the pattern. It is often specified in a
Literal
with a value which is a combination of regular characters, the wildcard character, the single character, and the escape character.
- Specified by:
getExpressions
in interfaceFilter<R>
- Returns:
- a list of size 2 containing the expression to be compared and the pattern, in that order.
-
getWildCard
@UML(identifier="wildCard", obligation=MANDATORY, specification=ISO_19143) default char getWildCard()Returns the character that can be used in the pattern to match any sequence of characters. The default value is the"%"
character.- Returns:
- the character for matching zero or more characters.
-
getSingleChar
@UML(identifier="singleChar", obligation=MANDATORY, specification=ISO_19143) default char getSingleChar()Returns the character that can be used in the pattern to match exactly one character. The default value is the"_"
character.- Returns:
- the character for matching exactly one character.
-
getEscapeChar
@UML(identifier="escapeChar", obligation=MANDATORY, specification=ISO_19143) default char getEscapeChar()Returns the character that can be used in the pattern to prefix one of the wild card characters to indicate that it should be matched literally in the content of the feature's property. The default value is the"\"
character.- Returns:
- the character for escaping a wildcard character.
-
isMatchingCase
Specifies how a filter expression processor should perform string comparisons. A value oftrue
means that string comparisons shall match case. The valuefalse
means that string comparisons are performed caselessly. The default valuetrue
.- Returns:
true
if comparisons are case sensitive, otherwisefalse
.
-