Class MergeAttributeEntryHandler

All Implemented Interfaces:
Function<LdapEntry,LdapEntry>, Freezable, LdapEntryHandler

public class MergeAttributeEntryHandler extends AbstractEntryHandler implements LdapEntryHandler
Merges the values of one or more attributes into a single attribute. The merged attribute may or may not already exist on the entry. If it does exist its existing values will remain intact.
  • Field Details

    • HASH_CODE_SEED

      private static final int HASH_CODE_SEED
      hash code seed.
      See Also:
    • mergeAttributeName

      private String mergeAttributeName
      Attribute name to add merge values into.
    • attributeNames

      private String[] attributeNames
      Attribute names to read values from.
  • Constructor Details

    • MergeAttributeEntryHandler

      public MergeAttributeEntryHandler()
      Default constructor.
    • MergeAttributeEntryHandler

      public MergeAttributeEntryHandler(String mergeName, String[] attrNames)
      Creates a ew merge attribute entry handler.
      Parameters:
      mergeName - attribute name to merge values into
      attrNames - attribute names to read values from
  • Method Details

    • getMergeAttributeName

      public String getMergeAttributeName()
      Returns the merge attribute name.
      Returns:
      merge attribute name
    • setMergeAttributeName

      public void setMergeAttributeName(String name)
      Sets the merge attribute name.
      Parameters:
      name - of the merge attribute
    • getAttributeNames

      public String[] getAttributeNames()
      Returns the attribute names.
      Returns:
      attribute names
    • setAttributeNames

      public void setAttributeNames(String... names)
      Sets the attribute names.
      Parameters:
      names - of the attributes
    • apply

      public LdapEntry apply(LdapEntry entry)
      Specified by:
      apply in interface Function<LdapEntry,LdapEntry>
    • handleAttributes

      protected void handleAttributes(LdapEntry entry)
      Description copied from class: AbstractEntryHandler
      Handle the attributes of a search entry.
      Overrides:
      handleAttributes in class AbstractEntryHandler
      Parameters:
      entry - search entry to extract the attributes from
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractEntryHandler
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class AbstractEntryHandler
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static MergeAttributeEntryHandler.Builder builder()
      Creates a builder for this class.
      Returns:
      new builder