Package org.apache.juneau.commons.utils
Class SystemUtils
java.lang.Object
org.apache.juneau.commons.utils.SystemUtils
System utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringSettingLooks up a system property or environment variable.static <T> TLooks up a system property or environment variable, returning a default if not found.static voidshutdownMessage(Supplier<String> message) Adds a console message to display when the JVM shuts down.
-
Method Details
-
shutdownMessage
Adds a console message to display when the JVM shuts down.- Parameters:
message- The message to display. Must not benull (evaluated at JVM shutdown).
-
env
Looks up a system property or environment variable.- Parameters:
name- The property name.- Returns:
- A StringSetting wrapping the value.
-
env
Looks up a system property or environment variable, returning a default if not found.- Type Parameters:
T- The type to convert the value to.- Parameters:
name- The property name.def- The default value. Can benull (returned as-is when the property is not found).- Returns:
- The found value, or the default.
-