public class Stu extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DAY |
static char[] |
EMPTY_CHAR_ARRAY |
static int[] |
EMPTY_INT_ARRAY |
static String[] |
EMPTY_STRING_ARRAY |
static long |
EPOCH_STARTED |
static long |
HOUR |
static long |
MINUTE |
static long |
SECOND |
static boolean |
VERBOSE_MODE |
| Modifier and Type | Method and Description |
|---|---|
static <T> String |
arrayToString(T[] ts) |
static String |
bitsToString(int bitflag) |
static String |
bitsToString(int bitflag,
int size,
char on,
char off,
boolean reverse) |
static String |
bitsToString(long bitflag) |
static String |
bitsToString(long bitflag,
int size,
char on,
char off,
boolean reverse) |
static String |
byteSizeToString(long sizeInByte) |
static <T> T |
chain(T t,
UnaryOperator<T> fx1,
UnaryOperator<T> fx2) |
static <T> T |
chain(T t,
UnaryOperator<T> fx1,
UnaryOperator<T> fx2,
UnaryOperator<T> fx3) |
static <T> T |
chain(T t,
UnaryOperator<T> fx1,
UnaryOperator<T> fx2,
UnaryOperator<T> fx3,
UnaryOperator<T> fx4) |
static <T> boolean |
contain(T[] ts,
T key) |
static int |
count(String haystack,
char needle) |
static int |
count(String haystack,
String needle) |
static <T> int |
count(T[] s,
T key) |
static String |
epochToString() |
static String |
epochToString(long milliseconds) |
static String |
epochToString(long milliseconds,
int offsetHr) |
static String |
epochToString(long milliseconds,
int offsetHr,
boolean signed) |
static char |
first(String s) |
static <T> T |
first(T[] t) |
static String |
getBetween(String s,
String prefix,
String suffix) |
static StackTraceElement |
getCaller(int skip) |
static String |
getCallerString(int skip) |
static int |
getDigits(int n) |
static int |
getDigits(long n) |
static long |
getEpoch() |
static int |
getHash(String s) |
static String |
getNth(String s,
char delim,
int index) |
static <T> T |
getNth(T[] tArr,
int index,
T fallback) |
static long |
getTimed(Runnable r) |
static boolean |
hasBits(int flag,
int mask,
boolean hasAll) |
static <T> T |
ifNull(T t,
T fallback) |
static String |
intComma(long n) |
static String |
intPadding(long positiveNumber,
int length,
char padding) |
static boolean |
isAlpha(char c) |
static boolean |
isAlphanumeric(String s) |
static boolean |
isBetween(String s,
String prefix,
String suffix) |
static boolean |
isDigit(char c) |
static boolean |
isDigit(String s) |
static <T> void |
iterateNotNull(T[] ts,
Consumer<T> fx) |
static String |
join(String delimiter,
Object... objs) |
static char |
last(String s) |
static <T> T |
last(T[] t) |
static void |
log(String msg) |
static void |
log(Supplier<String> msg) |
static <T> T |
mustGet(T t,
T fallback) |
static <X extends Throwable,T> |
mustGet(T t,
X exception) |
static String |
pad(String s,
int min,
int max,
char padding,
boolean leftPadding) |
static String |
padLeft(String s,
int length,
char padding) |
static String |
padRight(String s,
int length,
char padding) |
static void |
parseArgs(String[] args,
BiConsumer<String,String> f) |
static int |
parseInt(String s) |
static int |
parseInt(String s,
int fallback) |
static long |
parseLong(String s) |
static long |
parseLong(String s,
long fallback) |
static void |
println(Object... any) |
static void |
prints(String name,
Object... objs) |
static String |
removePrefix(String s,
char prefix) |
static String |
removePrefix(String s,
String prefix) |
static String |
removeSuffix(String s,
char suffix) |
static String |
removeSuffix(String s,
String suffix) |
static String |
repeat(char c,
int n)
Repeats char c for n times
|
static String |
repeat(String s,
int n)
Repeats a string for n times
|
static int |
setBits(int flag,
int mask,
boolean to) |
static void |
sleep(long ms) |
static <T> T[] |
subset(T[] src,
int start,
int end,
IntFunction<T[]> generator)
Subset of a T array
|
static String |
substring(String s,
int idx) |
static String |
substring(String s,
int idxFrom,
int idxTo) |
static String |
toHexString(byte[] bytes) |
static String |
trimLeft(String s) |
static String |
trimRight(String s) |
static String |
trimString(String input) |
public static final boolean VERBOSE_MODE
public static final long EPOCH_STARTED
public static final long SECOND
public static final long MINUTE
public static final long HOUR
public static final long DAY
public static final String[] EMPTY_STRING_ARRAY
public static final char[] EMPTY_CHAR_ARRAY
public static final int[] EMPTY_INT_ARRAY
public static <T> T[] subset(T[] src,
int start,
int end,
IntFunction<T[]> generator)
T - array Tsrc - Source T arraystart - start indexend - end indexgenerator - to create new T[] (ig. String[]::new)public static int count(String haystack, char needle)
public static <T> int count(T[] s,
T key)
public static <T> boolean contain(T[] ts,
T key)
public static <T> T getNth(T[] tArr,
int index,
T fallback)
public static <T> T first(T[] t)
public static <T> T last(T[] t)
public static char first(String s)
public static char last(String s)
public static long getEpoch()
public static String epochToString(long milliseconds, int offsetHr, boolean signed)
public static String epochToString(long milliseconds, int offsetHr)
public static String epochToString(long milliseconds)
public static String epochToString()
public static void println(Object... any)
public static int getDigits(int n)
public static int getDigits(long n)
public static void parseArgs(String[] args, BiConsumer<String,String> f)
public static StackTraceElement getCaller(int skip)
public static String getCallerString(int skip)
public static long getTimed(Runnable r)
public static void sleep(long ms)
public static void log(String msg)
public static <T> T mustGet(T t,
T fallback)
public static <X extends Throwable,T> T mustGet(T t, X exception) throws X extends Throwable
X extends Throwablepublic static <T> T ifNull(T t,
T fallback)
public static int parseInt(String s) throws NumberFormatException
NumberFormatExceptionpublic static int parseInt(String s, int fallback)
public static long parseLong(String s) throws NumberFormatException
NumberFormatExceptionpublic static long parseLong(String s, long fallback)
public static int getHash(String s)
public static boolean isDigit(String s)
public static boolean isDigit(char c)
public static boolean isAlpha(char c)
public static boolean isAlphanumeric(String s)
public static <T> void iterateNotNull(T[] ts,
Consumer<T> fx)
public static String bitsToString(long bitflag)
public static String bitsToString(long bitflag, int size, char on, char off, boolean reverse)
public static String bitsToString(int bitflag)
public static String bitsToString(int bitflag, int size, char on, char off, boolean reverse)
public static int setBits(int flag,
int mask,
boolean to)
public static boolean hasBits(int flag,
int mask,
boolean hasAll)
public static <T> T chain(T t,
UnaryOperator<T> fx1,
UnaryOperator<T> fx2)
public static <T> T chain(T t,
UnaryOperator<T> fx1,
UnaryOperator<T> fx2,
UnaryOperator<T> fx3)
public static <T> T chain(T t,
UnaryOperator<T> fx1,
UnaryOperator<T> fx2,
UnaryOperator<T> fx3,
UnaryOperator<T> fx4)
public static String repeat(char c, int n)
c - char to repeatn - number of repeatspublic static String repeat(String s, int n)
s - string to repeatn - number of repeatspublic static String byteSizeToString(long sizeInByte)
public static String toHexString(byte[] bytes)
public static <T> String arrayToString(T[] ts)
public static String intComma(long n)
public static String intPadding(long positiveNumber, int length, char padding)
Copyright © 2025. All rights reserved.