Package org.agrona
Class Strings
- java.lang.Object
-
- org.agrona.Strings
-
public final class Strings extends java.lang.Object
Utility functions for using Strings.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Strings()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isEmpty(java.lang.String value)
Is a string null or empty?static int
parseIntOrDefault(java.lang.String value, int defaultValue)
Parse an int from a String.
-
-
-
Method Detail
-
isEmpty
public static boolean isEmpty(java.lang.String value)
Is a string null or empty?- Parameters:
value
- to be tested.- Returns:
- true if the value is null or an empty string.
-
parseIntOrDefault
public static int parseIntOrDefault(java.lang.String value, int defaultValue) throws java.lang.NumberFormatException
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:
java.lang.NumberFormatException
-
-