Class TimeQuantity
java.lang.Object
java.lang.Number
org.infinispan.commons.util.TimeQuantity
- All Implemented Interfaces:
Serializable,Matchable<TimeQuantity>
Parser human-readable quantity of time.
- Since:
- 15.1
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondoublebooleanfloatinthashCode()intintValue()longtoString()static TimeQuantityvalueOf(long l) static TimeQuantityParses the byte quantity representation composed of a number plus a unit.static TimeQuantityMethods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
PARSER
-
-
Method Details
-
longValue
-
intValue
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
toDuration
-
toString
-
equals
-
hashCode
-
valueOf
Parses the byte quantity representation composed of a number plus a unit. When the unit is omitted, it is assumed as milliseconds. The supported units are:- ms: milliseconds
- s: seconds
- m: minutes
- h: hours
- d: days
Examples:
1000,1s,1.5h,10m- Parameters:
s- The String representing a quantity (can have decimals) plus the optional unit.- Returns:
- TimeQuantity
- Throws:
IllegalArgumentException- if the string cannot be parsed.
-
valueOf
-
valueOf
- Throws:
IllegalArgumentException
-