Class Utils
java.lang.Object
com.vladsch.flexmark.util.misc.Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic <T extends Comparable<T>>
intcompareNullable(T i1, T i2) static intstatic intstatic booleanendsWith(CharSequence receiver, String suffix, boolean ignoreCase) static booleanstatic booleanstatic voidescapeJavaString(@NotNull StringBuilder out, @NotNull CharSequence chars) static @NotNull StringescapeJavaString(@Nullable CharSequence param) static StringgetAbbreviatedText(String text, int maxLength) static StringgetLongestCommonPrefix(String... s) Longest Common Prefix for a set of stringsstatic <T> Tstatic <T, S extends T>
Sstatic StringgetResourceAsString(Class<?> clazz, String resourcePath) static Stringstatic Stringstatic Stringstatic Stringstatic StringifEmptyNullArgs(String receiver, String ifEmptyArg, String ifNotEmptyArg) static <T> TifNull(T receiver, T altValue) static <T> TifNullOr(T receiver, boolean condition, T altValue) static <T> Tstatic StringifNullOrBlank(String receiver, String altValue) static StringifNullOrEmpty(String receiver, String altValue) static <T> TifNullOrNot(T receiver, boolean condition, T altValue) static <T> TifNullOrNot(T receiver, Function<T, Boolean> condition, T altValue) static booleanstatic booleanstatic booleanisWhiteSpaceNoEOL(String receiver) static Stringstatic Stringstatic floatmax(float receiver, float... others) static intmax(int receiver, int... others) static floatmaxLimit(float receiver, float... maxBound) static intmaxLimit(int receiver, int... maxBound) static floatmin(float receiver, float... others) static intmin(int receiver, int... others) static floatminLimit(float receiver, float... minBound) static intminLimit(int receiver, int... minBound) static Stringstatic StringprefixWith(String receiver, char prefix) static StringprefixWith(String receiver, char prefix, boolean ignoreCase) static StringprefixWith(String receiver, String prefix) static StringprefixWith(String receiver, String prefix, boolean ignoreCase) static <K,V> V putIfMissing(Map<K, V> receiver, K key, Supplier<V> value) static @NotNull StringquoteJavaString(@Nullable CharSequence param) static floatrangeLimit(float receiver, float minBound, float maxBound) static intrangeLimit(int receiver, int minBound, int maxBound) static StringregexGroup(String receiver) static booleanregionMatches(CharSequence receiver, int thisOffset, String other, int otherOffset, int length, boolean ignoreCase) static StringremoveAnyPrefix(String receiver, String... prefixes) static StringremoveAnySuffix(String receiver, String... suffixes) static <K,V> void removeIf(Map<K, V> receiver, BiFunction<K, V, Boolean> removeFilter) static <K,V> void static StringremovePrefix(String receiver, char prefix) static StringremovePrefix(String receiver, String prefix) static StringremovePrefixIncluding(String receiver, String delimiter) static StringremoveSuffix(String receiver, char suffix) static StringremoveSuffix(String receiver, String suffix) static Stringstatic <T> Tstatic Stringstatic Stringsplice(Collection<String> receiver, String delimiter, boolean skipNullOrEmpty) static booleanstartsWith(CharSequence receiver, String prefix, boolean ignoreCase) static booleanstartsWith(String receiver, boolean ignoreCase, String... needles) static booleanstartsWith(String receiver, String... needles) static voidstreamAppend(StringBuilder sb, InputStream inputStream) static <T> List<? extends T> stringSorted(Collection<? extends T> receiver, Function<T, String> stringer) static StringsuffixWith(String receiver, char suffix) static StringsuffixWith(String receiver, char suffix, boolean ignoreCase) static StringsuffixWith(String receiver, String suffix) static StringsuffixWith(String receiver, String suffix, boolean ignoreCase) static StringsuffixWithEol(String receiver) static Stringstatic Stringstatic <K,V> Map <K, V> withDefaults(Map<K, V> receiver, Map<K, V> defaults) static Stringstatic Stringstatic Stringstatic String
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
ifNull
public static <T> T ifNull(T receiver, T altValue) -
ifNullOr
public static <T> T ifNullOr(T receiver, boolean condition, T altValue) -
ifNullOrNot
public static <T> T ifNullOrNot(T receiver, boolean condition, T altValue) -
ifNullOr
-
ifNullOrNot
-
ifNullOrEmpty
-
ifNullOrBlank
-
ifEmpty
-
ifEmpty
-
ifEmptyNullArgs
-
ifEmpty
-
ifEmpty
-
isBlank
-
isWhiteSpaceNoEOL
-
orEmpty
-
wrapWith
-
wrapWith
-
wrapWith
-
wrapWith
-
suffixWith
-
suffixWithEol
-
suffixWith
-
suffixWith
-
suffixWith
-
prefixWith
-
prefixWith
-
prefixWith
-
prefixWith
-
isIn
-
endsWith
-
endsWith
-
startsWith
-
startsWith
-
count
-
count
-
urlDecode
-
urlEncode
-
removePrefix
-
removePrefix
-
removeAnyPrefix
-
removePrefixIncluding
-
removeSuffix
-
removeSuffix
-
removeAnySuffix
-
stringSorted
public static <T> List<? extends T> stringSorted(Collection<? extends T> receiver, Function<T, String> stringer) -
regexGroup
-
regionMatches
public static boolean regionMatches(CharSequence receiver, int thisOffset, String other, int otherOffset, int length, boolean ignoreCase) -
endsWith
-
startsWith
-
splice
-
getLongestCommonPrefix
-
getAbbreviatedText
-
splice
-
join
-
join
-
repeat
-
max
public static int max(int receiver, int... others) -
min
public static int min(int receiver, int... others) -
minLimit
public static int minLimit(int receiver, int... minBound) -
maxLimit
public static int maxLimit(int receiver, int... maxBound) -
rangeLimit
public static int rangeLimit(int receiver, int minBound, int maxBound) -
max
public static float max(float receiver, float... others) -
min
public static float min(float receiver, float... others) -
minLimit
public static float minLimit(float receiver, float... minBound) -
maxLimit
public static float maxLimit(float receiver, float... maxBound) -
rangeLimit
public static float rangeLimit(float receiver, float minBound, float maxBound) -
compare
-
compareNullable
-
putIfMissing
-
withDefaults
-
removeIf
-
removeIf
-
streamAppend
-
getResourceAsString
-
escapeJavaString
-
quoteJavaString
-
escapeJavaString
public static void escapeJavaString(@NotNull @NotNull StringBuilder out, @NotNull @NotNull CharSequence chars) -
getOrNull
-
getOrNull
-
setOrAdd
-