- java.lang.Object
-
- cn.mcres.karlatemp.mxlib.tools.Toolkit
-
public class Toolkit extends Object
一个工具集合
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
Toolkit.IO
IO 数据操作static class
Toolkit.Reflection
反射工具static class
Toolkit.StackTrace
堆栈
-
构造器概要
构造器 构造器 说明 Toolkit()
-
方法概要
修饰符和类型 方法 说明 static boolean
asBoolean(Object o)
return value's boolean valuestatic <K,V>
Map.Entry<K,V>entry(K k, V v)
static <T> void
fill(@NotNull T[] args, int off, int length, @NotNull Supplier<T> supplier)
Fill the array 填充数组static <T> void
fill(@NotNull T[] args, @NotNull Supplier<T> supplier)
fill the array, 填充数组static <T> void
fill(@NotNull T[] args, T o)
static <T> void
fill(T[] args, int off, int length, T o)
File the array with same value.static <T> Class<T>
getClass(T obj)
static String
getClassSimpleName(String name)
Get class's simple name
获取类名的精简名static Function<String,String>
getPackageByClassName()
static @NotNull String
getPackageByClassName(String name)
Get class's package name.
截取类名的包名字static Comparator<String>
getPackageComparator()
Get the package name comparator.
获取包名比较器static ICommands
getRoot(ICommand command)
static boolean
isClassName(String check)
Check if the given string is a valid class name
检查给定的字符串是否是有效的类名static boolean
isNum(String s)
static ByteBuffer
ofUTF8ByteBuffer(String x)
把字符串转为 ByteBuffer(UTF_8)static <T> Callable<T>
toCallable(Object cb)
static <T,V,M extends Map<T,V>>
Collector<Map.Entry<T,V>,M,M>toMapCollector(Supplier<M> mapCreator)
-
-
-
方法详细资料
-
entry
public static <K,V> Map.Entry<K,V> entry(K k, V v)
- 类型参数:
K
- The key typeV
- The value type.- 参数:
k
- The entry keyv
- The entry value- 返回:
- A new Entry.
- 从以下版本开始:
- 2.11
-
toMapCollector
public static <T,V,M extends Map<T,V>> Collector<Map.Entry<T,V>,M,M> toMapCollector(Supplier<M> mapCreator)
-
toCallable
@Contract(pure=true, value="null -> null") public static <T> Callable<T> toCallable(Object cb)
- 类型参数:
T
- The type of the callable- 参数:
cb
- The function to invoke.- 返回:
- The callable need check
- 从以下版本开始:
- 2.5
-
getPackageByClassName
@NotNull @Contract(pure=true) public static @NotNull String getPackageByClassName(String name)
Get class's package name.
截取类名的包名字- 参数:
name
- 类的全名- 返回:
- 类的包名
-
getClassSimpleName
@Contract(pure=true) public static String getClassSimpleName(String name)
Get class's simple name
获取类名的精简名- 参数:
name
- 类全名- 返回:
- 类精简名
-
getPackageByClassName
@Contract(pure=true) public static Function<String,String> getPackageByClassName()
- 返回:
- The function of
getPackageByClassName(String)
- 另请参阅:
getPackageByClassName(String)
-
getPackageComparator
@Contract(pure=true) public static Comparator<String> getPackageComparator()
Get the package name comparator.
获取包名比较器- 返回:
- The comparator of package.
- 另请参阅:
getPackageByClassName(String)
-
getClass
@Contract(value="null -> null", pure=true) public static <T> Class<T> getClass(T obj)
- 类型参数:
T
- 对象类型- 返回:
- 对象的类|null
- 另请参阅:
Object.getClass()
-
isNum
@Contract(pure=true) public static boolean isNum(String s)
-
isClassName
@Contract(value="null -> false", pure=true) public static boolean isClassName(String check)
Check if the given string is a valid class name
检查给定的字符串是否是有效的类名- 参数:
check
- The name of check- 返回:
- true if the class name valid
- 从以下版本开始:
- 2.2
-
fill
public static <T> void fill(@NotNull @NotNull T[] args, @NotNull @NotNull Supplier<T> supplier)
fill the array, 填充数组- 类型参数:
T
- The type of array.- 参数:
args
- The array 数组supplier
- The supplier 获取器- 从以下版本开始:
- 2.4
-
fill
public static <T> void fill(@NotNull @NotNull T[] args, int off, int length, @NotNull @NotNull Supplier<T> supplier)
Fill the array 填充数组- 类型参数:
T
- The type of array- 参数:
args
- The array 数组off
- The start 起始点length
- length 长度限制supplier
- The supplier 获取器- 从以下版本开始:
- 2.4
-
fill
public static <T> void fill(@NotNull @NotNull T[] args, @Nullable T o)
-
fill
public static <T> void fill(T[] args, int off, int length, @Nullable T o)
File the array with same value. 使用同一个值填充数组- 类型参数:
T
- The type of array- 参数:
args
- The array 数组off
- start position 起始点length
- The fill size of array 填充的数组长度o
- The value 填充值- 从以下版本开始:
- 2.4
-
ofUTF8ByteBuffer
@Contract(pure=true) public static ByteBuffer ofUTF8ByteBuffer(String x)
把字符串转为 ByteBuffer(UTF_8)- 参数:
x
- 字符串- 返回:
- 编码后的ByteBuffer, 如果需要附加字符串长度请使用 position(0)
- 从以下版本开始:
- 2.4
-
asBoolean
@Contract(value="null -> false", pure=true) public static boolean asBoolean(Object o)
return value's boolean value- 参数:
o
- The value- 返回:
- The boolean match
- 从以下版本开始:
- 2.5
-
-