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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Durationevaluate(String value, Supplier<EvaluationContext> evaluationContext) Evaluates and potentially parses the given string representation into aDurationvalue.static Durationevaluate(String value, ValueEvaluationContext evaluationContext) Evaluates and potentially parses the given string representation into aDurationvalue.static Duration
-
Constructor Details
-
DurationUtil
public DurationUtil()
-
-
Method Details
-
evaluate
Evaluates and potentially parses the given string representation into aDurationvalue.- Parameters:
value- theStringrepresentation 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 aDurationvalue.- Parameters:
value- theStringrepresentation 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:
-