public static class ConditionFactory.KeyValueCondition extends java.lang.Object implements Condition, Condition.ToTagConvertable
Represents a key/value condition which is either applied to a primitive.
Condition.Context, Condition.ToTagConvertable
Modifier and Type | Field and Description |
---|---|
boolean |
considerValAsKey
If this flag is set,
v is treated as a key and the value is the value set for that key. |
java.lang.String |
k
The key to search for.
|
ConditionFactory.Op |
op
The key/value match operation.
|
java.lang.String |
v
The value to search for.
|
Constructor and Description |
---|
KeyValueCondition(java.lang.String k,
java.lang.String v,
ConditionFactory.Op op,
boolean considerValAsKey)
Creates a key/value-condition.
|
Modifier and Type | Method and Description |
---|---|
boolean |
applies(Environment env)
Checks if the condition applies in the given MapCSS
Environment . |
Tag |
asTag(OsmPrimitive primitive)
Converts the current condition to a tag
|
boolean |
requiresExactKeyMatch()
Determines if this condition requires an exact key match.
|
java.lang.String |
toString() |
public final java.lang.String k
public final java.lang.String v
public final ConditionFactory.Op op
public final boolean considerValAsKey
v
is treated as a key and the value is the value set for that key.public KeyValueCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op, boolean considerValAsKey)
Creates a key/value-condition.
k
- the keyv
- the valueop
- the operationconsiderValAsKey
- whether to consider v
as another key and compare the values of key k
and key v
.public boolean requiresExactKeyMatch()
true
if this condition requires an exact key match.public boolean applies(Environment env)
Condition
Environment
.public Tag asTag(OsmPrimitive primitive)
Condition.ToTagConvertable
asTag
in interface Condition.ToTagConvertable
primitive
- A primitive to use as context. May be ignored.public java.lang.String toString()
toString
in class java.lang.Object