Class TimeInterval
java.lang.Object
org.apache.tapestry5.commons.util.TimeInterval
Used to represent a period of time, specifically as a configuration value. This is often used to specify timeouts.
TimePeriods are parsed from strings.
The string specifys a number of terms. The values of all the terms are summed together to form the total time period.
Each term consists of a number followed by a unit. Units (from largest to smallest) are:
- y
- year
- d
- day
- h
- hour
- m
- minute
- s
- second
- ms
- millisecond
-
Constructor Summary
ConstructorsConstructorDescriptionTimeInterval(long milliseconds) TimeInterval(String input) Creates a TimeInterval for a string. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglongseconds()Converts the milliseconds back into a string (compatible withTimeInterval(String)).toString()
-
Constructor Details
-
TimeInterval
Creates a TimeInterval for a string.- Parameters:
input- the string specifying the amount of time in the period
-
TimeInterval
-
-
Method Details
-
milliseconds
-
seconds
-
toDescription
Converts the milliseconds back into a string (compatible withTimeInterval(String)).- Since:
- 5.2.0
-
toString
-
equals
-