Interface BeanCopier


public interface BeanCopier
Bean复制者

方法说明

  • get*()系列方法作用:把其他类型转换为正确的primitive类型
  • copyBean()方法作用:把sourceObject的属性复制到targetObject中
Author:
John Li
  • Method Details

    • copyBean

      Object copyBean(Object sourceObject, Object target, boolean targetIsClass)
      将源对象的属性复制到目标对象的属性。
      Parameters:
      sourceObject - 要从中复制属性的源对象。
      target - 要复制属性的目标类或对象。
      targetIsClass - 目标是否为类,如果为类,则需要new初始化;为对象,则直接使用。
      Returns:
      targetObject 返回目标对象。
    • getBoolean

      static boolean getBoolean(Object sourceVal)
      获取布尔
      Parameters:
      sourceVal - 源值
      Returns:
      boolean
    • getChar

      static char getChar(Object sourceVal)
      获得字符
      Parameters:
      sourceVal - 源值
      Returns:
      char
    • getByte

      static byte getByte(Object sourceVal)
      获得字节
      Parameters:
      sourceVal - 源值
      Returns:
      byte
    • getShort

      static short getShort(Object sourceVal)
      获得短
      Parameters:
      sourceVal - 源值
      Returns:
      short
    • getInt

      static int getInt(Object sourceVal)
      获得int
      Parameters:
      sourceVal - 源值
      Returns:
      int
    • getLong

      static long getLong(Object sourceVal)
      获得长
      Parameters:
      sourceVal - 源值
      Returns:
      long
    • getFloat

      static float getFloat(Object sourceVal)
      获得浮动
      Parameters:
      sourceVal - 源值
      Returns:
      float
    • getDouble

      static double getDouble(Object sourceVal)
      获得浮动
      Parameters:
      sourceVal - 源值
      Returns:
      double