Package org.agrona

Class Strings

java.lang.Object
org.agrona.Strings

public final class Strings extends Object
Utility functions for using Strings.
  • Constructor Details

    • Strings

      private Strings()
  • Method Details

    • isEmpty

      public static boolean isEmpty(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(String value, int defaultValue) throws 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:
      NumberFormatException