public final class TTL extends Object
Modifier and Type | Field and Description |
---|---|
static long |
MAX_VALUE |
Modifier and Type | Method and Description |
---|---|
static String |
format(long ttl) |
static long |
parse(String s,
boolean clamp)
Parses a TTL-like value, which can either be expressed as a number or a BIND-style string with
numbers and units.
|
static long |
parseTTL(String s)
Parses a TTL, which can either be expressed as a number or a BIND-style string with numbers and
units.
|
public static final long MAX_VALUE
public static long parse(String s, boolean clamp)
s
- The string representing the numeric value.clamp
- Whether to clamp values in the range [MAX_VALUE + 1, 2^32 -1] to MAX_VALUE. This
should be donw for TTLs, but not other values which can be expressed in this format.NumberFormatException
- The string was not in a valid TTL format.public static long parseTTL(String s)
s
- The string representing the TTLNumberFormatException
- The string was not in a valid TTL format.public static String format(long ttl)
Copyright © 2021 dnsjava.org. All rights reserved.