Package org.ldaptive.handler
Class CaseChangeEntryHandler
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.handler.AbstractEntryHandler
-
- org.ldaptive.handler.CaseChangeEntryHandler
-
- All Implemented Interfaces:
Function<LdapEntry,LdapEntry>
,Freezable
,LdapEntryHandler
public class CaseChangeEntryHandler extends AbstractEntryHandler implements LdapEntryHandler
Provides the ability to modify the case of search entry DNs, attribute names, and attribute values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CaseChangeEntryHandler.Builder
Case change entry handler builder.static class
CaseChangeEntryHandler.CaseChange
Enum to define the type of case change.
-
Field Summary
Fields Modifier and Type Field Description private CaseChangeEntryHandler.CaseChange
attributeNameCaseChange
Type of case modification to make to the attribute names.private String[]
attributeNames
Attribute names to modify.private CaseChangeEntryHandler.CaseChange
attributeValueCaseChange
Type of case modification to make to the attributes values.private CaseChangeEntryHandler.CaseChange
dnCaseChange
Type of case modification to make to the entry DN.private static int
HASH_CODE_SEED
hash code seed.-
Fields inherited from class org.ldaptive.handler.AbstractEntryHandler
logger
-
-
Constructor Summary
Constructors Constructor Description CaseChangeEntryHandler()
Default constructor.CaseChangeEntryHandler(CaseChangeEntryHandler.CaseChange dnChange, CaseChangeEntryHandler.CaseChange attrNameChange, CaseChangeEntryHandler.CaseChange attrValueChange, String... attrNames)
Creates a new case change entry handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapEntry
apply(LdapEntry entry)
static CaseChangeEntryHandler.Builder
builder()
Creates a builder for this class.boolean
equals(Object o)
CaseChangeEntryHandler.CaseChange
getAttributeNameCaseChange()
Returns the attribute name case change.String[]
getAttributeNames()
Returns the attribute names.CaseChangeEntryHandler.CaseChange
getAttributeValueCaseChange()
Returns the attribute value case change.CaseChangeEntryHandler.CaseChange
getDnCaseChange()
Returns the DN case change.protected String
handleAttributeName(String name)
Returns the supplied attribute name unaltered.protected void
handleAttributes(LdapEntry entry)
Handle the attributes of a search entry.protected String
handleAttributeValue(String value)
Returns the supplied attribute value unaltered.protected String
handleDn(LdapEntry entry)
Handle the dn of a search entry.int
hashCode()
void
setAttributeNameCaseChange(CaseChangeEntryHandler.CaseChange cc)
Sets the attribute name case change.void
setAttributeNames(String... names)
Sets the attribute names.void
setAttributeValueCaseChange(CaseChangeEntryHandler.CaseChange cc)
Sets the attribute value case change.void
setDnCaseChange(CaseChangeEntryHandler.CaseChange cc)
Sets the DN case change.String
toString()
-
Methods inherited from class org.ldaptive.handler.AbstractEntryHandler
handleAttribute, handleAttributeValue, 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
-
dnCaseChange
private CaseChangeEntryHandler.CaseChange dnCaseChange
Type of case modification to make to the entry DN.
-
attributeNameCaseChange
private CaseChangeEntryHandler.CaseChange attributeNameCaseChange
Type of case modification to make to the attribute names.
-
attributeValueCaseChange
private CaseChangeEntryHandler.CaseChange attributeValueCaseChange
Type of case modification to make to the attributes values.
-
attributeNames
private String[] attributeNames
Attribute names to modify.
-
-
Constructor Detail
-
CaseChangeEntryHandler
public CaseChangeEntryHandler()
Default constructor.
-
CaseChangeEntryHandler
public CaseChangeEntryHandler(CaseChangeEntryHandler.CaseChange dnChange, CaseChangeEntryHandler.CaseChange attrNameChange, CaseChangeEntryHandler.CaseChange attrValueChange, String... attrNames)
Creates a new case change entry handler.- Parameters:
dnChange
- to apply to entry DNattrNameChange
- to apply to attribute namesattrValueChange
- to apply to attribute valuesattrNames
- to apply these changes to
-
-
Method Detail
-
getDnCaseChange
public CaseChangeEntryHandler.CaseChange getDnCaseChange()
Returns the DN case change.- Returns:
- case change
-
setDnCaseChange
public void setDnCaseChange(CaseChangeEntryHandler.CaseChange cc)
Sets the DN case change.- Parameters:
cc
- case change
-
getAttributeNameCaseChange
public CaseChangeEntryHandler.CaseChange getAttributeNameCaseChange()
Returns the attribute name case change.- Returns:
- case change
-
setAttributeNameCaseChange
public void setAttributeNameCaseChange(CaseChangeEntryHandler.CaseChange cc)
Sets the attribute name case change.- Parameters:
cc
- case change
-
getAttributeValueCaseChange
public CaseChangeEntryHandler.CaseChange getAttributeValueCaseChange()
Returns the attribute value case change.- Returns:
- case change
-
setAttributeValueCaseChange
public void setAttributeValueCaseChange(CaseChangeEntryHandler.CaseChange cc)
Sets the attribute value case change.- Parameters:
cc
- case change
-
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
-
handleDn
protected String handleDn(LdapEntry entry)
Description copied from class:AbstractEntryHandler
Handle the dn of a search entry.- Overrides:
handleDn
in classAbstractEntryHandler
- Parameters:
entry
- search entry to extract the dn from- Returns:
- handled dn
-
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
-
handleAttributeName
protected String handleAttributeName(String name)
Description copied from class:AbstractEntryHandler
Returns the supplied attribute name unaltered.- Overrides:
handleAttributeName
in classAbstractEntryHandler
- Parameters:
name
- to handle- Returns:
- handled name
-
handleAttributeValue
protected String handleAttributeValue(String value)
Description copied from class:AbstractEntryHandler
Returns the supplied attribute value unaltered.- Overrides:
handleAttributeValue
in classAbstractEntryHandler
- Parameters:
value
- to handle- Returns:
- handled value
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractEntryHandler
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractEntryHandler
-
builder
public static CaseChangeEntryHandler.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-