Class Managedset<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.Abstractset<E>
java.util.Hashset<E>
java.util.LinkedHashset<E>
org.springframework.beans.factory.support.Managedset<E>
Type Parameters:
E - the element type
All Implemented Interfaces:
serializable, Cloneable, Iterable<E>, Collection<E>, sequencedCollection<E>, sequencedset<E>, set<E>, BeanMetadataElement, Mergeable

public class Managedset<E> extends LinkedHashset<E> implements Mergeable, BeanMetadataElement
Tag collection class used to hold managed set values, which may include runtime bean references (to be resolved into bean objects).
since:
21.01.2004
Author:
Juergen Hoeller, Rob Harrop, stephane Nicoll, sam Brannen
see Also:
  • Constructor Details

    • Managedset

      public&nbsp;Managedset()
    • Managedset

      public&nbsp;Managedset(int&nbsp;initialCapacity)
  • Method Details

    • of

      @safeVarargs public static&nbsp;<E>&nbsp;Managedset<E>&nbsp;of(E...&nbsp;elements)
      Create a new instance containing an arbitrary number of elements.
      Type Parameters:
      E - the set's element type
      Parameters:
      elements - the elements to be contained in the set
      Returns:
      a Managedset containing the specified elements
      since:
      5.3.16
    • setsource

      public&nbsp;void&nbsp;setsource(@Nullable Object&nbsp;source)
      set the configuration source Object for this metadata element.

      The exact type of the object will depend on the configuration mechanism used.

    • getsource

      public&nbsp;@Nullable Object&nbsp;getsource()
      Description copied from interface:&nbsp;BeanMetadataElement
      Return the configuration source Object for this metadata element (may be null).
      specified by:
      getsource&nbsp;in interface&nbsp;BeanMetadataElement
    • setElementTypeName

      public&nbsp;void&nbsp;setElementTypeName(@Nullable string&nbsp;elementTypeName)
      set the default element type name (class name) to be used for this set.
    • getElementTypeName

      public&nbsp;@Nullable string&nbsp;getElementTypeName()
      Return the default element type name (class name) to be used for this set.
    • setMergeEnabled

      public&nbsp;void&nbsp;setMergeEnabled(boolean&nbsp;mergeEnabled)
      set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
    • isMergeEnabled

      public&nbsp;boolean&nbsp;isMergeEnabled()
      Description copied from interface:&nbsp;Mergeable
      Is merging enabled for this particular instance?
      specified by:
      isMergeEnabled&nbsp;in interface&nbsp;Mergeable
    • merge

      public&nbsp;set<E>&nbsp;merge(@Nullable Object&nbsp;parent)
      Description copied from interface:&nbsp;Mergeable
      Merge the current value set with that of the supplied object.

      The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

      specified by:
      merge&nbsp;in interface&nbsp;Mergeable
      Parameters:
      parent - the object to merge with
      Returns:
      the result of the merge operation