Class DurationUtil

java.lang.Object
org.springframework.data.mongodb.util.DurationUtil

public class DurationUtil extends Object
Helper to evaluate Duration from expressions.
Since:
4.4
Author:
Christoph Strobl
  • Constructor Details

    • DurationUtil

      public DurationUtil()
  • Method Details

    • evaluate

      public static Duration evaluate(String value, ValueEvaluationContext evaluationContext)
      Evaluates and potentially parses the given string representation into a Duration value.
      Parameters:
      value - the String representation of the duration to evaluate.
      evaluationContext - context supplier for property and expression language evaluation.
      Returns:
      the evaluated duration.
    • evaluate

      public static Duration evaluate(String value, Supplier<EvaluationContext> evaluationContext)
      Evaluates and potentially parses the given string representation into a Duration value.
      Parameters:
      value - the String representation of the duration to evaluate.
      evaluationContext - context supplier for expression language evaluation.
      Returns:
      the evaluated duration.
    • parse

      public static Duration parse(String duration)
      Parameters:
      duration - duration string to parse.
      Returns:
      parsed Duration.
      See Also: