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
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MergeAttributeEntryHandler.Builder
Merge attribute entry handler builder.
-
Field Summary
Fields Modifier and Type Field Description private String[]
attributeNames
Attribute names to read values from.private static int
HASH_CODE_SEED
hash code seed.private String
mergeAttributeName
Attribute name to add merge values into.-
Fields inherited from class org.ldaptive.handler.AbstractEntryHandler
logger
-
-
Constructor Summary
Constructors Constructor Description MergeAttributeEntryHandler()
Default constructor.MergeAttributeEntryHandler(String mergeName, String[] attrNames)
Creates a ew merge attribute entry handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapEntry
apply(LdapEntry entry)
static MergeAttributeEntryHandler.Builder
builder()
Creates a builder for this class.boolean
equals(Object o)
String[]
getAttributeNames()
Returns the attribute names.String
getMergeAttributeName()
Returns the merge attribute name.protected void
handleAttributes(LdapEntry entry)
Handle the attributes of a search entry.int
hashCode()
void
setAttributeNames(String... names)
Sets the attribute names.void
setMergeAttributeName(String name)
Sets the merge attribute name.String
toString()
-
Methods inherited from class org.ldaptive.handler.AbstractEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntry
-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
mergeAttributeName
private String mergeAttributeName
Attribute name to add merge values into.
-
attributeNames
private String[] attributeNames
Attribute names to read values from.
-
-
Method Detail
-
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
-
handleAttributes
protected void handleAttributes(LdapEntry entry)
Description copied from class:AbstractEntryHandler
Handle the attributes of a search entry.- Overrides:
handleAttributes
in classAbstractEntryHandler
- Parameters:
entry
- search entry to extract the attributes from
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractEntryHandler
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractEntryHandler
-
builder
public static MergeAttributeEntryHandler.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-