Package 

Class BeanProxy.BeanInstance

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      BeanProxy.BeanInstance<B> setProperty(@NotNull() String db_field_name, @Nullable() Object value) 设置一个属性,该方法不会自动转换value的类型。 如代理对象的`id`是`Long`或者`Int`类型,现在有一个`BigDecimal`类型的值,如何将这个`BigDecimal`设置到`id`上呢? 参考如下代码:
          BeanInstance<Object> instance = BeanProxy.fromBean(bean);
          String field_name = "id";
      
          Object typedValue = new ObjectMapper().convertValue(bigDecimalId, instance.getPropertyType(field_name));
          instance.setProperty(field_name, typedValue);
      
      ```java ```
      Object getProperty(@NotNull() String db_field_name) get
      Class<out Object> getPropertyType(@NotNull() String db_field_name) 获取某属性的类型
      B toBean() 获取bean
      Class<B> getBeanType() 获取bean的类型
      ClassParser.ParsedClass getParsedClass()
      Iterator<Map.Entry<String, Object>> iterator() 以Map.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanProxy.BeanInstance

        BeanProxy.BeanInstance(B instance, BeanProxy<B> proxy)
    • Method Detail

      • setProperty

        @NotNull() BeanProxy.BeanInstance<B> setProperty(@NotNull() String db_field_name, @Nullable() Object value)

        设置一个属性,该方法不会自动转换value的类型。 如代理对象的`id`是`Long`或者`Int`类型,现在有一个`BigDecimal`类型的值,如何将这个`BigDecimal`设置到`id`上呢? 参考如下代码:

            BeanInstance<Object> instance = BeanProxy.fromBean(bean);
            String field_name = "id";
        
            Object typedValue = new ObjectMapper().convertValue(bigDecimalId, instance.getPropertyType(field_name));
            instance.setProperty(field_name, typedValue);
        
        ```java ```
      • toBean

        @Nullable() B toBean()

        获取bean