Class AttributeUtil

java.lang.Object
com.atlassian.crowd.util.AttributeUtil

public final class AttributeUtil extends Object
  • Method Details

    • safeParseDurationMillis

      public static Duration safeParseDurationMillis(String attribute, Duration defaultDuration)
      Returns the value of the provided string parsed as a duration or returns the fallback value if the attribute cannot be parsed or is null. The provided string is assumed to be in milliseconds.
      Parameters:
      attribute - the string to parse
      defaultDuration - the default duration to be used if the attribute cannot be parsed.
      Returns:
      the successfully parsed value or the provided default