Package org.ldaptive.handler
Class MergeAttributeEntryHandler
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.handler.AbstractEntryHandler
org.ldaptive.handler.MergeAttributeEntryHandler
- All Implemented Interfaces:
Function<LdapEntry,,LdapEntry> Freezable,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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMerge attribute entry handler builder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]Attribute names to read values from.private static final inthash code seed.private StringAttribute name to add merge values into.Fields inherited from class org.ldaptive.handler.AbstractEntryHandler
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.MergeAttributeEntryHandler(String mergeName, String[] attrNames) Creates a ew merge attribute entry handler. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder for this class.booleanString[]Returns the attribute names.Returns the merge attribute name.protected voidhandleAttributes(LdapEntry entry) Handle the attributes of a search entry.inthashCode()voidsetAttributeNames(String... names) Sets the attribute names.voidsetMergeAttributeName(String name) Sets the merge attribute name.toString()Methods inherited from class org.ldaptive.handler.AbstractEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntryMethods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
mergeAttributeName
Attribute name to add merge values into. -
attributeNames
Attribute names to read values from.
-
-
Constructor Details
-
MergeAttributeEntryHandler
public MergeAttributeEntryHandler()Default constructor. -
MergeAttributeEntryHandler
Creates a ew merge attribute entry handler.- Parameters:
mergeName- attribute name to merge values intoattrNames- attribute names to read values from
-
-
Method Details
-
getMergeAttributeName
Returns the merge attribute name.- Returns:
- merge attribute name
-
setMergeAttributeName
Sets the merge attribute name.- Parameters:
name- of the merge attribute
-
getAttributeNames
Returns the attribute names.- Returns:
- attribute names
-
setAttributeNames
Sets the attribute names.- Parameters:
names- of the attributes
-
apply
-
handleAttributes
Description copied from class:AbstractEntryHandlerHandle the attributes of a search entry.- Overrides:
handleAttributesin classAbstractEntryHandler- Parameters:
entry- search entry to extract the attributes from
-
equals
- Overrides:
equalsin classAbstractEntryHandler
-
hashCode
public int hashCode()- Specified by:
hashCodein classAbstractEntryHandler
-
toString
-
builder
Creates a builder for this class.- Returns:
- new builder
-