java.lang.Object
org.opencastproject.util.data.functions.Strings

public final class Strings extends Object
Functions for strings.
  • Method Details

    • trimToNone

      public static Optional<String> trimToNone(String a)
      Trim a string and return either some or none if it's empty. The string may be null.
    • asString

      public static Optional<String> asString(Object a)
      Return a.toString() wrapped in a some if a != null, none otherwise.
    • asStringNull

      public static String asStringNull(Object a)
      Return a.toString() or <null> if argument is null.
    • toDouble

      public static Optional<Double> toDouble(String s)
      Convert a string into a long if possible.
    • toInt

      public static Optional<Integer> toInt(String s)
      Convert a string into an integer if possible.
    • format

      public static <A> String format(Format f, A a)
    • trimToNil

      public static List<String> trimToNil(String a)
    • split

      public static String[] split(Pattern splitter, String s)
      Create a split function from a regex pattern.