Class StringHelpers

java.lang.Object
net.apartium.cocoabeans.StringHelpers

public class StringHelpers extends Object
A class consisting of string utility methods
  • Constructor Details

    • StringHelpers

      public StringHelpers()
  • Method Details

    • parseInteger

      public static OptionalInt parseInteger(String arg)
      Attempts to parse given string arg as a number.
      Parameters:
      arg - string argument
      Returns:
      empty if parsing was not successful, otherwise resulting number boxed with option
    • parseDouble

      public static OptionalDouble parseDouble(String arg)
      Attempts to parse given string arg as a number.
      Parameters:
      arg - string argument
      Returns:
      empty if parsing was not successful, otherwise resulting number boxed with option
    • parseFloat

      public static OptionalFloat parseFloat(String arg)
      Attempts to parse given string arg as a number.
      Parameters:
      arg - string argument
      Returns:
      empty if parsing was not successful, otherwise resulting number boxed with option
    • parseLong

      public static OptionalLong parseLong(String arg)
      Attempts to parse given string arg as a number.
      Parameters:
      arg - string argument
      Returns:
      empty if parsing was not successful, otherwise resulting number boxed with option
    • isNullOrEmpty

      public static boolean isNullOrEmpty(String arg)
      Checks if given string is null or empty.
      Parameters:
      arg - given string
      Returns:
      true if null or empty, else false