Interface OptNullType<K>

All Superinterfaces:
BasicType<K>, OptBasicType<K>
All Known Subinterfaces:
OptNullObject<K>, OptNullString<K>
All Known Implementing Classes:
MapProxy

public interface OptNullType<K> extends BasicType<K>, OptBasicType<K>
基本类型的getter接口抽象实现 提供一个统一的接口定义返回不同类型的值(基本类型) 在不提供默认值的情况下, 如果值不存在或获取错误,返回null
Since:
Java 17+
Author:
Kimi Liu
  • Method Details

    • getObject

      default Object getObject(K key)
      Description copied from interface: BasicType
      获取Object属性值
      Specified by:
      getObject in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getString

      default String getString(K key)
      获取字符串型属性值 无值或获取错误返回null
      Specified by:
      getString in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getInt

      default Integer getInt(K key)
      获取int型属性值 无值或获取错误返回null
      Specified by:
      getInt in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getShort

      default Short getShort(K key)
      获取short型属性值 无值或获取错误返回null
      Specified by:
      getShort in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getBoolean

      default Boolean getBoolean(K key)
      获取boolean型属性值 无值或获取错误返回null
      Specified by:
      getBoolean in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getLong

      default Long getLong(K key)
      获取long型属性值 无值或获取错误返回null
      Specified by:
      getLong in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getChar

      default Character getChar(K key)
      获取char型属性值 无值或获取错误返回null
      Specified by:
      getChar in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getFloat

      default Float getFloat(K key)
      获取float型属性值 无值或获取错误返回null
      Specified by:
      getFloat in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getDouble

      default Double getDouble(K key)
      获取double型属性值 无值或获取错误返回null
      Specified by:
      getDouble in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getByte

      default Byte getByte(K key)
      获取byte型属性值 无值或获取错误返回null
      Specified by:
      getByte in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getBigDecimal

      default BigDecimal getBigDecimal(K key)
      获取BigDecimal型属性值 无值或获取错误返回null
      Specified by:
      getBigDecimal in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getBigInteger

      default BigInteger getBigInteger(K key)
      获取BigInteger型属性值 无值或获取错误返回null
      Specified by:
      getBigInteger in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值
    • getEnum

      default <E extends Enum<E>> E getEnum(Class<E> clazz, K key)
      获取Enum型属性值 无值或获取错误返回null
      Specified by:
      getEnum in interface BasicType<K>
      Type Parameters:
      E - 枚举类型
      Parameters:
      clazz - Enum 的 Class
      key - 属性名
      Returns:
      属性值
    • getDate

      default Date getDate(K key)
      获取Date型属性值 无值或获取错误返回null
      Specified by:
      getDate in interface BasicType<K>
      Parameters:
      key - 属性名
      Returns:
      属性值