public final class Strings extends Object
| Modifier and Type | Field and Description |
|---|---|
static Function<String,String[]> |
csvSplit
Split function to split comma separated values.
|
static Function<String,List<String>> |
csvSplitList
Split function to split comma separated values.
|
static Function<String,String> |
lowerCase
A function to convert all of the characters in this String to lower case using the rules of the default locale.
|
static Predicate<String> |
notBlank |
static Function<String,Boolean> |
toBool
Convert a string into a boolean.
|
static Function<String,Option<Double>> |
toDouble
Convert a string into a long if possible.
|
static Function<String,Option<Integer>> |
toInt
Convert a string into an integer if possible.
|
static Function<String,List<Integer>> |
toIntL
Convert a string into an integer if possible.
|
static Function<String,Option<Long>> |
toLong
Convert a string into a long if possible.
|
static Function<String,List<String>> |
trimToNil |
static Function<String,Option<String>> |
trimToNone
Trim a string and return either
some or none if it's empty. |
| Modifier and Type | Method and Description |
|---|---|
static Function<String,String> |
append(String suffix)
A function to append a suffix to the argument string.
|
static <A> Function<A,Option<String>> |
asString()
Return
a.toString() wrapped in a some if a != null, none otherwise. |
static Option<String> |
asString(Object a)
Return
a.toString() wrapped in a some if a != null, none otherwise. |
static <A> Function<A,String> |
asStringNull()
Return
a.toString() or <null> if argument is null. |
static Function2<String,String,String> |
concat(String sep)
Return a string concatenation function.
|
static Predicate<String> |
contains(String seq)
A predicate function to check if a string contains a specified sequence.
|
static Predicate<String> |
eqIgnoreCase(String other) |
static <A> Function2<String,A[],String> |
format()
Return a string formatting function.
|
static <A> Function<A,String> |
format(Format f) |
static Predicate<String> |
matches(String pattern)
A predicate function to match a regular expression.
|
static Function<String,String> |
prepend(String prefix)
A function to prepend the argument string with a prefix.
|
static Function<String,String> |
replaceAll(String regex,
String replacement)
Return a function that replaces all occurrences of
regex in the argument with replacement
. |
static Function<String,String[]> |
split(Pattern splitter)
Create a split function from a regex pattern.
|
static Option<String> |
trimToNone(String a)
Trim a string and return either
some or none if it's empty. |
public static final Function<String,Option<String>> trimToNone
some or none if it's empty. The string may be null.public static final Function<String,Option<Long>> toLong
public static final Function<String,Option<Double>> toDouble
public static final Function<String,Option<Integer>> toInt
public static final Function<String,List<Integer>> toIntL
public static final Function<String,Boolean> toBool
Boolean.valueOf(String)public static final Function<String,String[]> csvSplit
\s*,\s*.public static final Function<String,List<String>> csvSplitList
\s*,\s*.public static Option<String> trimToNone(String a)
some or none if it's empty. The string may be null.public static Option<String> asString(Object a)
a.toString() wrapped in a some if a != null, none otherwise.public static <A> Function<A,Option<String>> asString()
a.toString() wrapped in a some if a != null, none otherwise.public static <A> Function<A,String> asStringNull()
a.toString() or <null> if argument is null.public static <A> Function2<String,A[],String> format()
String.format(String, Object...)public static Function<String,String> replaceAll(String regex, String replacement)
regex in the argument with replacement
.String.replaceAll(String, String)public static Function<String,String[]> split(Pattern splitter)
public static Function<String,String> prepend(String prefix)
public static Function<String,String> append(String suffix)
public static Predicate<String> matches(String pattern)
public static Predicate<String> contains(String seq)
Copyright © 2009–2020 Opencast Project. All rights reserved.