Package org.agrona
Class Strings
java.lang.Object
org.agrona.Strings
Utility functions for using Strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Is a string null or empty?static int
parseIntOrDefault
(String value, int defaultValue) Parse an int from a String.
-
Constructor Details
-
Strings
private Strings()
-
-
Method Details
-
isEmpty
Is a string null or empty?- Parameters:
value
- to be tested.- Returns:
- true if the value is null or an empty string.
-
parseIntOrDefault
Parse an int from a String. If the String is null then return the defaultValue.- Parameters:
value
- to be parsed.defaultValue
- to be used if the String value is null.- Returns:
- the int value of the string or the default on null.
- Throws:
NumberFormatException
-