程序包 | 说明 |
---|---|
org.nutz.castor |
解决强类型语言的类型转换的烦恼
如果你有一个逗号分隔的字符串,你想转换成一个整形数组,怎么办呢?
|
org.nutz.castor.castor |
Nutz内置的全部的castor实现
|
org.nutz.lang |
Java语法糖,封装众多常用实用方法
这个包很大,没办法,谁让 Java 的 API 不太方便呢?
|
限定符和类型 | 方法和说明 |
---|---|
abstract TO |
Castor.cast(FROM src,
Class<?> toType,
String... args) |
<F,T> T |
Castors.cast(Object src,
Class<F> fromType,
Class<T> toType,
String... args)
转换一个 POJO 从一个指定的类型到另外的类型
|
<T> T |
Castors.castTo(Object src,
Class<T> toType)
转换一个 POJO 到另外的类型
|
protected static Collection<?> |
Castor.createCollection(Object src,
Class<?> toType) |
限定符和类型 | 方法和说明 |
---|---|
String |
Boolean2String.cast(Boolean src,
Class<?> toType,
String... args) |
Boolean |
Boolean2Boolean.cast(Boolean src,
Class<?> toType,
String... args) |
Date |
Calendar2Datetime.cast(Calendar src,
Class<?> toType,
String... args) |
String |
Collection2String.cast(Collection src,
Class<?> toType,
String... args) |
Object |
Collection2Object.cast(Collection src,
Class<?> toType,
String... args) |
Map |
Collection2Map.cast(Collection src,
Class<?> toType,
String... args) |
Collection |
Collection2Collection.cast(Collection src,
Class<?> toType,
String... args) |
Object |
Collection2Array.cast(Collection src,
Class<?> toType,
String... args) |
Timestamp |
SqlDate2Timestamp.cast(Date src,
Class<?> toType,
String... args) |
Timestamp |
Datetime2Timpestamp.cast(Date src,
Class<?> toType,
String... args) |
Time |
Datetime2SqlTime.cast(Date src,
Class<?> toType,
String... args) |
Date |
Datetime2SqlDate.cast(Date src,
Class<?> toType,
String... args) |
Calendar |
Datetime2Calendar.cast(Date src,
Class<?> toType,
String... args) |
String |
Enum2String.cast(Enum src,
Class<?> toType,
String... args) |
Number |
Enum2Number.cast(Enum src,
Class<?> toType,
String... args) |
String |
File2String.cast(File src,
Class<?> toType,
String... args) |
String |
Map2String.cast(Map src,
Class<?> toType,
String... args) |
Object |
Map2Object.cast(Map src,
Class<?> toType,
String... args) |
Enum |
Map2Enum.cast(Map src,
Class<?> toType,
String... args) |
Collection |
Map2Collection.cast(Map src,
Class<?> toType,
String... args) |
Object |
Map2Array.cast(Map src,
Class<?> toType,
String... args) |
Enum |
Number2Enum.cast(Number src,
Class<?> toType,
String... args) |
Character |
Number2Char.cast(Number src,
Class<?> toType,
String... args) |
String |
Object2String.cast(Object src,
Class<?> toType,
String... args) |
Object |
Object2Object.cast(Object src,
Class<?> toType,
String... args) |
Mirror |
Object2Mirror.cast(Object src,
Class<?> toType,
String... args) |
Map |
Object2Map.cast(Object src,
Class<?> toType,
String... args) |
List |
Object2List.cast(Object src,
Class<?> toType,
String... args) |
Class |
Object2Class.cast(Object src,
Class<?> toType,
String... args) |
String |
Array2String.cast(Object src,
Class<?> toType,
String... args) |
Object |
Array2Object.cast(Object src,
Class<?> toType,
String... args) |
Map |
Array2Map.cast(Object src,
Class<?> toType,
String... args) |
Collection<?> |
Array2Collection.cast(Object src,
Class<?> toType,
String... args) |
Object |
Array2Array.cast(Object src,
Class<?> toType,
String... args) |
Set |
String2Set.cast(String src,
Class<?> toType,
String... args) |
Pattern |
String2Pattern.cast(String src,
Class<?> toType,
String... args) |
Object |
String2Object.cast(String src,
Class<?> toType,
String... args) |
Map |
String2Map.cast(String src,
Class<?> toType,
String... args) |
File |
String2File.cast(String src,
Class<?> toType,
String... args) |
Enum |
String2Enum.cast(String src,
Class<?> toType,
String... args) |
Collection |
String2Collection.cast(String src,
Class<?> toType,
String... args) |
Character |
String2Character.cast(String src,
Class<?> toType,
String... args) |
Object |
String2Array.cast(String src,
Class<?> toType,
String... args) |
Timestamp |
SqlTime2Timestamp.cast(Time src,
Class<?> toType,
String... args) |
Time |
Timestamp2SqlTime.cast(Timestamp src,
Class<?> toType,
String... args) |
Date |
Timestamp2SqlDate.cast(Timestamp src,
Class<?> toType,
String... args) |
Date |
Timestamp2Datetime.cast(Timestamp src,
Class<?> toType,
String... args) |
限定符和类型 | 方法和说明 |
---|---|
static Object |
Lang.array2array(Object array,
Class<?> eleType)
将数组转换成另外一种类型的数组。
|
static <T> Object[] |
Lang.array2ObjectArray(T[] args,
Class<?>[] pts)
将数组转换成Object[] 数组。
|
static <T> T |
Lang.map2Object(Map<?,?> src,
Class<T> toType)
根据一个 Map,和给定的对象类型,创建一个新的 JAVA 对象
|
Copyright © 2017. All rights reserved.