Class Strings

java.lang.Object
au.csiro.pathling.utilities.Strings

public abstract class Strings extends Object
Utility class containing some methods for string wrangling.
Author:
John Grimes
  • Constructor Details

    • Strings

      public Strings()
  • Method Details

    • unSingleQuote

      @Nonnull public static String unSingleQuote(@Nonnull String value)
      Parameters:
      value - a String surrounded by single quotes
      Returns:
      the unquoted String
    • randomAlias

      @Nonnull public static String randomAlias()
      Returns:
      a short, random String for use as a column alias
    • parseCsvList

      @Nonnull public static <T> List<T> parseCsvList(@Nonnull String csvList, @Nonnull Function<String,T> converter)
      Leniently parses a list of coma separated values. Trims the strings and filters out empty values.
      Type Parameters:
      T - the type of elements to produce.
      Parameters:
      csvList - a coma separated list of equivalence codes
      converter - a function that converts single value string to the desired type T
      Returns:
      the list of converted values of type T.