Class SearchCompiler.ExactKeyValue
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.search.SearchCompiler.Match
-
- org.openstreetmap.josm.data.osm.search.SearchCompiler.TaggedMatch
-
- org.openstreetmap.josm.data.osm.search.SearchCompiler.ExactKeyValue
-
- All Implemented Interfaces:
java.util.function.Predicate<OsmPrimitive>
- Enclosing class:
- SearchCompiler
public static class SearchCompiler.ExactKeyValue extends SearchCompiler.TaggedMatch
Matches objects with the exact given key-value pair.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchCompiler.ExactKeyValue.Mode
The mode to use for the comparison
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
key
private java.util.regex.Pattern
keyPattern
private SearchCompiler.ExactKeyValue.Mode
mode
private java.lang.String
value
private java.util.regex.Pattern
valuePattern
-
Constructor Summary
Constructors Constructor Description ExactKeyValue(boolean regexp, boolean caseSensitive, java.lang.String key, java.lang.String value)
Constructs a newExactKeyValue
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getKey()
SearchCompiler.ExactKeyValue.Mode
getMode()
java.lang.String
getValue()
int
hashCode()
boolean
match(Tagged osm)
Tests whether the tagged object matches this criterion.java.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.data.osm.search.SearchCompiler.TaggedMatch
compilePattern, match
-
Methods inherited from class org.openstreetmap.josm.data.osm.search.SearchCompiler.Match
test, validate
-
-
-
-
Field Detail
-
key
private final java.lang.String key
-
value
private final java.lang.String value
-
keyPattern
private final java.util.regex.Pattern keyPattern
-
valuePattern
private final java.util.regex.Pattern valuePattern
-
mode
private final SearchCompiler.ExactKeyValue.Mode mode
-
-
Constructor Detail
-
ExactKeyValue
public ExactKeyValue(boolean regexp, boolean caseSensitive, java.lang.String key, java.lang.String value) throws SearchParseError
Constructs a newExactKeyValue
.- Parameters:
regexp
- regular expressioncaseSensitive
-true
to perform a case-sensitive searchkey
- keyvalue
- value- Throws:
SearchParseError
- if a parse error occurs
-
-
Method Detail
-
match
public boolean match(Tagged osm)
Description copied from class:SearchCompiler.Match
Tests whether the tagged object matches this criterion.- Specified by:
match
in classSearchCompiler.TaggedMatch
- Parameters:
osm
- the tagged object to test- Returns:
- true if the tagged object matches this criterion
-
getKey
public java.lang.String getKey()
-
getValue
public java.lang.String getValue()
-
getMode
public SearchCompiler.ExactKeyValue.Mode getMode()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-