Enum Class BeanCollectionUsage

java.lang.Object
java.lang.Enum<BeanCollectionUsage>
io.beanmapper.annotations.BeanCollectionUsage
All Implemented Interfaces:
Serializable, Comparable<BeanCollectionUsage>, java.lang.constant.Constable

public enum BeanCollectionUsage extends Enum<BeanCollectionUsage>
Determines how to deal with the target collection. If the value is set to CONSTRUCT, it will also be recreated, even if it already exists. If REUSE is set, it will attempt to reuse the collection if it exists, or else CONSTRUCT it. If CLEAR is set, it will call clear() on the collection, unless it does not exist (call CONSTRUCT).
  • Enum Constant Details

    • CONSTRUCT

      public static final BeanCollectionUsage CONSTRUCT
      Always reconstruct the target collection
    • REUSE

      public static final BeanCollectionUsage REUSE
      Reuse the target collection if it exists; construct if not.
    • CLEAR

      public static final BeanCollectionUsage CLEAR
      Call clear on the target collection if it exists; construct if not. DEFAULT option
  • Method Details

    • values

      public static BeanCollectionUsage[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BeanCollectionUsage valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • mustClear

      public boolean mustClear()
    • mustConstruct

      public boolean mustConstruct(Object targetCollection)