Package org.agrona
Class Strings
java.lang.Object
org.agrona.Strings
Utility functions for using Strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanIs a string null or empty?static intparseIntOrDefault(String value, int defaultValue) Parse an int from a String.
-
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
-