Class PropertyEqualityCondition
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.boolex.PropertyConditionBase
ch.qos.logback.core.boolex.PropertyEqualityCondition
- All Implemented Interfaces:
PropertyCondition,Condition,ContextAware,LifeCycle
Condition that evaluates to
true when a property
equals a specified expected value.
The property named by key is resolved using the
inherited property lookup mechanism (see PropertyConditionBase).
If the resolved property value equals value (using
String.equals(Object)), this condition evaluates to true.
- Since:
- 1.5.20
-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate()Evaluate the condition: resolve the property named bykeyand compare it tovalue.getKey()Return the property key that will be looked up when evaluating the condition.getValue()Return the configured expected value.voidSet the property key to resolve during evaluation.voidSet the expected value that the resolved property must equal for this condition to evaluate totrue.voidstart()Start the component and validate required parameters.Methods inherited from class ch.qos.logback.core.boolex.PropertyConditionBase
getLocalPropertyContainer, isDefined, isNull, isStarted, p, property, propertyContains, propertyEquals, setLocalPropertyContainer, stopMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Constructor Details
-
PropertyEqualityCondition
public PropertyEqualityCondition()
-
-
Method Details
-
start
Start the component and validate required parameters. If eitherkeyorvalueisnull, an error is reported and the component does not start.- Specified by:
startin interfaceLifeCycle- Overrides:
startin classPropertyConditionBase
-
getValue
-
setValue
-
getKey
-
setKey
-
evaluate
Evaluate the condition: resolve the property named bykeyand compare it tovalue.- Returns:
trueif the resolved property equals the expected value;falseotherwise
-