Package org.kairosdb.client.builder
Class RelativeTime
- java.lang.Object
-
- org.kairosdb.client.builder.RelativeTime
-
public class RelativeTime extends Object
A time unit relative to now.
-
-
Constructor Summary
Constructors Constructor Description RelativeTime()RelativeTime(int value, TimeUnit unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)longgetTimeRelativeTo(long time)Returns the time in milliseconds relative to the specified time.StringgetUnit()The unit of time.intgetValue()The time's value.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
RelativeTime
public RelativeTime()
-
RelativeTime
public RelativeTime(int value, TimeUnit unit)
-
-
Method Detail
-
getValue
public int getValue()
The time's value.- Returns:
- time value
-
getUnit
public String getUnit()
The unit of time.- Returns:
- time unit
-
getTimeRelativeTo
public long getTimeRelativeTo(long time)
Returns the time in milliseconds relative to the specified time. For example, if this object is set to 3 days, this method returns 3 days fromtime.- Parameters:
time- time to calculate the relative time.- Returns:
- time in milliseconds relative to the specified time
-
-