- java.lang.Object
-
- com.zerodeplibs.webpush.header.TTL
-
-
Field Summary
Fields Modifier and Type Field Description static StringHEADER_NAMEThe name of the TTL header field.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longdays(long days)Convert the given TTL in days to seconds.static longhours(long hours)Convert the given TTL in hours to seconds.static longminutes(long minutes)Convert the given TTL in minutes to seconds.static longseconds(long seconds)Check if the given TTL in seconds isn't negative.
-
-
-
Field Detail
-
HEADER_NAME
public static String HEADER_NAME
The name of the TTL header field.
-
-
Method Detail
-
days
public static long days(long days)
Convert the given TTL in days to seconds.- Parameters:
days- the TTL in days(how many days a push message is retained by the push service).- Returns:
- the TTL in seconds.
- Throws:
IllegalArgumentException- if the given days is negative.
-
hours
public static long hours(long hours)
Convert the given TTL in hours to seconds.- Parameters:
hours- the TTL in hours(how many hours a push message is retained by the push service).- Returns:
- the TTL in seconds.
- Throws:
IllegalArgumentException- if the given hours is negative.
-
minutes
public static long minutes(long minutes)
Convert the given TTL in minutes to seconds.- Parameters:
minutes- the TTL in minutes (how many minutes a push message is retained by the push service).- Returns:
- the TTL in seconds.
- Throws:
IllegalArgumentException- if the given minutes is negative.
-
seconds
public static long seconds(long seconds)
Check if the given TTL in seconds isn't negative.- Parameters:
seconds- the TTL in seconds (how many seconds a push message is retained by the push service).- Returns:
- the given seconds.
- Throws:
IllegalArgumentException- if the given seconds is negative.
-
-