public final class Splitter extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Splitter.MapSplitter
The Class MapSplitter.
|
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
WHITE_SPACE_PATTERN |
| Modifier and Type | Method and Description |
|---|---|
static Splitter |
defauLt()
Returns the Splitter with the default delimiter:
", ". |
Splitter |
limit(int limit) |
Splitter |
omitEmptyStrings() |
Splitter |
omitEmptyStrings(boolean omitEmptyStrings)
Deprecated.
replaced with
omitEmptyStrings() |
static Splitter |
pattern(CharSequence delimiterRegex) |
<C extends Collection<String>> |
split(C output,
CharSequence source) |
<T,C extends Collection<T>> |
split(C output,
Class<T> targetType,
CharSequence source) |
List<String> |
split(CharSequence source) |
<C extends Collection<String>> |
split(CharSequence source,
Supplier<? extends C> supplier) |
<R,E extends Exception> |
split(CharSequence source,
Throwables.Function<? super String,R,E> mapper) |
<T> List<T> |
split(Class<T> targetType,
CharSequence source) |
<T,C extends Collection<T>> |
split(Class<T> targetType,
CharSequence source,
Supplier<? extends C> supplier) |
<T,C extends Collection<T>> |
split(C output,
com.landawn.abacus.type.Type<T> targetType,
CharSequence source) |
<T> List<T> |
split(com.landawn.abacus.type.Type<T> targetType,
CharSequence source) |
<T,C extends Collection<T>> |
split(com.landawn.abacus.type.Type<T> targetType,
CharSequence source,
Supplier<? extends C> supplier) |
<T,E extends Exception> |
splitAndThen(CharSequence source,
Throwables.Function<? super List<String>,T,E> converter)
Split and then.
|
String[] |
splitToArray(CharSequence source)
Split to array.
|
<E extends Exception> |
splitToArray(CharSequence source,
Throwables.Function<? super String,String,E> mapper)
Split to array.
|
<T> T |
splitToArray(Class<T> arrayType,
CharSequence source)
Split to array.
|
String[] |
splitToArray(String[] output,
CharSequence source)
Split to array.
|
ImmutableList<String> |
splitToImmutableList(CharSequence source)
Split to array.
|
<T> ImmutableList<T> |
splitToImmutableList(Class<T> targetType,
CharSequence source)
Split to array.
|
Splitter |
strip(boolean strip)
Deprecated.
replaced with
stripResults() |
Splitter |
stripResults() |
Splitter |
trim(boolean trim)
Deprecated.
replaced with
trimResults() |
Splitter |
trimResults() |
static Splitter |
with(char delimiter) |
static Splitter |
with(CharSequence delimiter) |
static Splitter |
with(Pattern delimiter) |
public static final Pattern WHITE_SPACE_PATTERN
public static Splitter defauLt()
", ".public static Splitter with(char delimiter)
delimiter - public static Splitter with(CharSequence delimiter) throws IllegalArgumentException
delimiter - IllegalArgumentException - if the specified delimiter is null or empty.public static Splitter with(Pattern delimiter) throws IllegalArgumentException
delimiter - IllegalArgumentException - if the specified delimiter is null, or empty string may be matched by it.public static Splitter pattern(CharSequence delimiterRegex) throws IllegalArgumentException
delimiterRegex - IllegalArgumentException - if the specified delimiter is null or empty, or empty string may be matched by it.@Deprecated public Splitter omitEmptyStrings(boolean omitEmptyStrings)
omitEmptyStrings()omitEmptyStrings - public Splitter omitEmptyStrings()
@Deprecated public Splitter trim(boolean trim)
trimResults()trim - public Splitter trimResults()
@Deprecated public Splitter strip(boolean strip)
stripResults()strip is true.strip - Character.isWhitespace(char)public Splitter stripResults()
public Splitter limit(int limit)
limit - public List<String> split(CharSequence source)
source - public <R,E extends Exception> List<R> split(CharSequence source, Throwables.Function<? super String,R,E> mapper) throws E extends Exception
source - mapper - E extends Exceptionpublic <T> List<T> split(Class<T> targetType, CharSequence source)
T - targetType - source - public <T> List<T> split(com.landawn.abacus.type.Type<T> targetType, CharSequence source)
T - targetType - source - public <C extends Collection<String>> C split(C output, CharSequence source)
C - output - source - public <T,C extends Collection<T>> C split(C output, Class<T> targetType, CharSequence source)
T - C - output - targetType - source - public <T,C extends Collection<T>> C split(C output, com.landawn.abacus.type.Type<T> targetType, CharSequence source)
T - C - output - targetType - source - public <C extends Collection<String>> C split(CharSequence source, Supplier<? extends C> supplier)
C - source - supplier - public <T,C extends Collection<T>> C split(Class<T> targetType, CharSequence source, Supplier<? extends C> supplier)
T - C - targetType - source - supplier - public <T,C extends Collection<T>> C split(com.landawn.abacus.type.Type<T> targetType, CharSequence source, Supplier<? extends C> supplier)
T - C - targetType - source - supplier - public ImmutableList<String> splitToImmutableList(CharSequence source)
source - public <T> ImmutableList<T> splitToImmutableList(Class<T> targetType, CharSequence source)
T - arrayType - source - public String[] splitToArray(String[] output, CharSequence source)
output - source - public String[] splitToArray(CharSequence source)
source - public <E extends Exception> String[] splitToArray(CharSequence source, Throwables.Function<? super String,String,E> mapper) throws E extends Exception
source - E extends Exceptionpublic <T> T splitToArray(Class<T> arrayType, CharSequence source)
T - arrayType - source - public <T,E extends Exception> T splitAndThen(CharSequence source, Throwables.Function<? super List<String>,T,E> converter) throws E extends Exception
T - E - source - converter - E - the eE extends ExceptionCopyright © 2021. All rights reserved.