Class DurationUtil
java.lang.Object
org.springframework.data.mongodb.util.DurationUtil
Helper to evaluate Duration from expressions.
- Since:
- 4.4
- Author:
- Christoph Strobl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Duration
evaluate
(String value, Supplier<EvaluationContext> evaluationContext) Evaluates and potentially parses the given string representation into aDuration
value.static Duration
evaluate
(String value, ValueEvaluationContext evaluationContext) Evaluates and potentially parses the given string representation into aDuration
value.static Duration
-
Constructor Details
-
DurationUtil
public DurationUtil()
-
-
Method Details
-
evaluate
Evaluates and potentially parses the given string representation into aDuration
value.- Parameters:
value
- theString
representation of the duration to evaluate.evaluationContext
- context supplier for property and expression language evaluation.- Returns:
- the evaluated duration.
-
evaluate
Evaluates and potentially parses the given string representation into aDuration
value.- Parameters:
value
- theString
representation of the duration to evaluate.evaluationContext
- context supplier for expression language evaluation.- Returns:
- the evaluated duration.
-
parse
- Parameters:
duration
- duration string to parse.- Returns:
- parsed
Duration
. - See Also:
-