Package org.aoju.bus.core.getter
Interface OptNullString<K>
- All Superinterfaces:
BasicType<K>,OptBasicType<K>,OptNullType<K>
基本类型的getter接口抽象实现,所有类型的值获取都是通过将String转换而来
用户只需实现getStr方法即可,其他类型将会从String结果中转换 在不提供默认值的情况下, 如果值不存在或获取错误,返回null
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptiondefault BigDecimalgetBigDecimal(K key, BigDecimal defaultValue) 获取BigDecimal型属性值 若获得的值为不可见字符,使用默认值default BigIntegergetBigInteger(K key, BigInteger defaultValue) 获取BigInteger型属性值 若获得的值为不可见字符,使用默认值default BooleangetBoolean(K key, Boolean defaultValue) 获取boolean型属性值 若获得的值为不可见字符,使用默认值default Byte获取byte型属性值 若获得的值为不可见字符,使用默认值default Character获取char型属性值 若获得的值为不可见字符,使用默认值default Date获取Date类型值default Double获取double型属性值 若获得的值为不可见字符,使用默认值default <E extends Enum<E>>
E获得Enum类型的值default Float获取float型属性值 若获得的值为不可见字符,使用默认值default Integer获取int型属性值 若获得的值为不可见字符,使用默认值default Long获取Long型属性值 若获得的值为不可见字符,使用默认值default Object获取Object属性值default Short获取short型属性值 若获得的值为不可见字符,使用默认值Methods inherited from interface org.aoju.bus.core.getter.OptBasicType
getStringMethods inherited from interface org.aoju.bus.core.getter.OptNullType
getBigDecimal, getBigInteger, getBoolean, getByte, getChar, getDate, getDouble, getEnum, getFloat, getInt, getLong, getObject, getShort, getString
-
Method Details
-
getObject
Description copied from interface:OptBasicType获取Object属性值- Specified by:
getObjectin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getInt
Description copied from interface:OptBasicType获取int型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getIntin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getShort
Description copied from interface:OptBasicType获取short型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getShortin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getBoolean
Description copied from interface:OptBasicType获取boolean型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getBooleanin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getLong
Description copied from interface:OptBasicType获取Long型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getLongin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getChar
Description copied from interface:OptBasicType获取char型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getCharin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getFloat
Description copied from interface:OptBasicType获取float型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getFloatin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getDouble
Description copied from interface:OptBasicType获取double型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getDoublein interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getByte
Description copied from interface:OptBasicType获取byte型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getBytein interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getBigDecimal
Description copied from interface:OptBasicType获取BigDecimal型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getBigDecimalin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getBigInteger
Description copied from interface:OptBasicType获取BigInteger型属性值 若获得的值为不可见字符,使用默认值- Specified by:
getBigIntegerin interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- 属性值, 无对应值返回defaultValue
-
getEnum
Description copied from interface:OptBasicType获得Enum类型的值- Specified by:
getEnumin interfaceOptBasicType<K>- Type Parameters:
E- 枚举类型- Parameters:
clazz- Enum的Classkey- KEYdefaultValue- 默认值- Returns:
- Enum类型的值, 无则返回Null
-
getDate
Description copied from interface:OptBasicType获取Date类型值- Specified by:
getDatein interfaceOptBasicType<K>- Parameters:
key- 属性名defaultValue- 默认值- Returns:
- Date类型属性值
-