Package cn.xuanyuanli.core.lang
Class Record
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
一个进阶版的Map,一般作为数据库表的一行数据存在。注意他与Map的最大区别是:如果把Bean转换为Record,则默认驼峰命名变为下划线命名方式
- Author:
- John Li
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertBeanToMap(Object javaBean) Bean对象转换为Map,所有字段名都由驼峰转为下划线格式getBigDecimal(String column) Get column of mysql type: decimal, numericgetBigInteger(String column) Get column of mysql type: unsigned bigintgetBoolean(String column) Get column of mysql type: bit, tinyint(1)byte[]Get column of mysql type: binary, varbinary, tinyblob, blob, mediumblob, longblob I have not finished the test.Get column of mysql type: date, yearGet column of mysql type: real, doubleGet column of mysql type: floatgetId()get idGet column of mysql type: int, integer, tinyint(n) n > 1, smallint, mediumint获得intprivate <T> List<T> 获得列表getListRecord(String key) get list recordgetListString(String key) get listGet column of mysql type: bigint获得长Get column of any type that extends from Number获得记录Get column of mysql type: varchar, char, enum, set, text, tinytext, mediumtext, longtext获得str设置<T> T实体static RecordBean对象转换为Record,所有字段名都由驼峰转为下划线格式static RecordvalueOfNullable(Object obj) 值可以为空Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID串行版本uid- See Also:
-
-
Constructor Details
-
Record
public Record()记录 -
Record
记录- Parameters:
map- 地图
-
Record
public Record(int size) 记录- Parameters:
size- 大小
-
-
Method Details
-
getStr
Get column of mysql type: varchar, char, enum, set, text, tinytext, mediumtext, longtext- Parameters:
column- 列- Returns:
String
-
getStr
获得str- Parameters:
column- 列defaultStr- 默认str- Returns:
String
-
getInt
Get column of mysql type: int, integer, tinyint(n) n > 1, smallint, mediumint- Parameters:
column- 列- Returns:
Integer
-
getInt
获得int- Parameters:
column- 列def- def- Returns:
Integer
-
getLong
Get column of mysql type: bigint- Parameters:
column- 列- Returns:
Long
-
getLong
获得长- Parameters:
column- 列def- def- Returns:
Long
-
getBigInteger
Get column of mysql type: unsigned bigint- Parameters:
column- 列- Returns:
BigInteger
-
getDate
Get column of mysql type: date, year- Parameters:
column- 列- Returns:
Date
-
getDouble
Get column of mysql type: real, double- Parameters:
column- 列- Returns:
Double
-
getFloat
Get column of mysql type: float- Parameters:
column- 列- Returns:
Float
-
getBoolean
Get column of mysql type: bit, tinyint(1)- Parameters:
column- 列- Returns:
Boolean
-
getBigDecimal
Get column of mysql type: decimal, numeric- Parameters:
column- 列- Returns:
BigDecimal
-
getBytes
Get column of mysql type: binary, varbinary, tinyblob, blob, mediumblob, longblob I have not finished the test.- Parameters:
column- 列- Returns:
-
invalid reference
byte[]
-
getNumber
Get column of any type that extends from Number- Parameters:
column- 列- Returns:
Number
-
getId
get id- Returns:
Long
-
getListRecord
get list record -
getList
获得列表 -
getListString
get list -
set
设置- Parameters:
key- 键value- 价值- Returns:
Record
-
valueOf
Bean对象转换为Record,所有字段名都由驼峰转为下划线格式- Parameters:
obj- obj- Returns:
Record
-
getRecord
获得记录- Parameters:
key- 键- Returns:
Record
-
convertBeanToMap
Bean对象转换为Map,所有字段名都由驼峰转为下划线格式 -
toEntity
实体- Type Parameters:
T- 泛型- Parameters:
tClass- t类- Returns:
Record
-
valueOfNullable
值可以为空- Parameters:
obj- obj- Returns:
Record
-