- java.lang.Object
-
- io.netty5.util.internal.SystemPropertyUtil
-
public final class SystemPropertyUtil extends Object
A collection of utility methods to retrieve and parse the values of the Java system properties.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontains(String key)Returnstrueif and only if the system property with the specifiedkeyexists.static Stringget(String key)Returns the value of the Java system property with the specifiedkey, while falling back tonullif the property access fails.static Stringget(String key, String def)Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.static booleangetBoolean(String key, boolean def)Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.static intgetInt(String key, int def)Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.static longgetLong(String key, long def)Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.
-
-
-
Method Detail
-
contains
public static boolean contains(String key)
Returnstrueif and only if the system property with the specifiedkeyexists.
-
get
public static String get(String key)
Returns the value of the Java system property with the specifiedkey, while falling back tonullif the property access fails.- Returns:
- the property value or
null
-
get
public static String get(String key, String def)
Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
defif there's no such property or if an access to the specified property is not allowed.
-
getBoolean
public static boolean getBoolean(String key, boolean def)
Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
defif there's no such property or if an access to the specified property is not allowed.
-
getInt
public static int getInt(String key, int def)
Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
defif there's no such property or if an access to the specified property is not allowed.
-
getLong
public static long getLong(String key, long def)
Returns the value of the Java system property with the specifiedkey, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
defif there's no such property or if an access to the specified property is not allowed.
-
-