Class BeanCopy

java.lang.Object
jodd.bean.BeanCopy

public class BeanCopy extends Object
Powerful tool for copying properties from one bean into another. BeanCopy works with POJO beans, but also with Map.
See Also:
  • Field Details

    • source

      private final Object source
    • destination

      private Object destination
    • forced

      private boolean forced
    • declared

      private boolean declared
    • isTargetMap

      private boolean isTargetMap
    • filter

      private Predicate<String> filter
    • filter2

      private BiPredicate<String,Object> filter2
    • includeFields

      private boolean includeFields
  • Constructor Details

    • BeanCopy

      public BeanCopy(Object source, Object destination)
      Creates new BeanCopy process between the source and the destination. Both source and destination can be a POJO object or a Map.
    • BeanCopy

      private BeanCopy(Object source)
  • Method Details

    • from

      public static BeanCopy from(Object source)
      Creates BeanCopy with given POJO bean as a source.
    • to

      public BeanCopy to(Object destination)
      Defines destination, detects a map.
    • declared

      public BeanCopy declared(boolean declared)
      Defines if all properties should be copied (when set to true) or only public (when set to false, default).
    • forced

      public BeanCopy forced(boolean forced)
    • filter

      public BeanCopy filter(Predicate<String> filter)
    • filter

      public BeanCopy filter(BiPredicate<String,Object> filter)
    • includeFields

      public BeanCopy includeFields(boolean includeFields)
    • copy

      public void copy()
      Performs the copying.