Class ConfigurationParameters.Milliseconds
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.ConfigurationParameters.Milliseconds
-
- Enclosing class:
- ConfigurationParameters
public static final class ConfigurationParameters.Milliseconds extends Object
Helper class for configuration parameters that denote a "duration", such as a timeout or expiration time.
-
-
Field Summary
Fields Modifier and Type Field Description static ConfigurationParameters.Milliseconds
FOREVER
static ConfigurationParameters.Milliseconds
NEVER
static ConfigurationParameters.Milliseconds
NULL
long
value
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
static ConfigurationParameters.Milliseconds
of(long value)
Returns a new milliseconds object from the given long value.static @Nullable ConfigurationParameters.Milliseconds
of(@Nullable String str)
Parses a value string into a duration.static @NotNull ConfigurationParameters.Milliseconds
of(@Nullable String str, @NotNull ConfigurationParameters.Milliseconds defaultValue)
-
-
-
Field Detail
-
NULL
public static final ConfigurationParameters.Milliseconds NULL
-
FOREVER
public static final ConfigurationParameters.Milliseconds FOREVER
-
NEVER
public static final ConfigurationParameters.Milliseconds NEVER
-
value
public final long value
-
-
Method Detail
-
of
public static ConfigurationParameters.Milliseconds of(long value)
Returns a new milliseconds object from the given long value.- Parameters:
value
- the value- Returns:
- the milliseconds object
-
of
@Nullable public static @Nullable ConfigurationParameters.Milliseconds of(@Nullable @Nullable String str)
Parses a value string into a duration. the String has the following format:<xmp> format:= (value [ unit ])+; value:= float value; unit: "ms" | "s" | "m" | "h" | "d"; </xmp> Example: <xmp> "100", "100ms" : 100 milliseconds "1s 50ms": 1050 milliseconds "1.5d": 1 1/2 days == 36 hours. </xmp>
- Parameters:
str
- the string to parse- Returns:
- the new Milliseconds object or null.
-
of
@NotNull public static @NotNull ConfigurationParameters.Milliseconds of(@Nullable @Nullable String str, @NotNull @NotNull ConfigurationParameters.Milliseconds defaultValue)
-
-