Package org.ldaptive.ad.handler
Class ObjectGuidHandler
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.transport.MessageFunctional<Q,S>
-
- org.ldaptive.transport.MessageFunctional.Function<SearchRequest,SearchResponse,T,T>
-
- org.ldaptive.transport.AbstractMessageFunctionalEntryHandler<T>
-
- org.ldaptive.ad.handler.AbstractBinaryAttributeHandler<LdapEntry>
-
- org.ldaptive.ad.handler.ObjectGuidHandler
-
- All Implemented Interfaces:
Function<LdapEntry,LdapEntry>,Freezable,LdapEntryHandler
public class ObjectGuidHandler extends AbstractBinaryAttributeHandler<LdapEntry> implements LdapEntryHandler
Processes an objectGuid attribute by converting it from binary to its string form.
-
-
Field Summary
Fields Modifier and Type Field Description private static StringATTRIBUTE_NAMEobjectGuid attribute name.private static intHASH_CODE_SEEDhash code seed.private booleanwithBracketswhether to enclose the guid in brackets.-
Fields inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
logger
-
-
Constructor Summary
Constructors Constructor Description ObjectGuidHandler()Creates a new object guid handler.ObjectGuidHandler(boolean brackets)Creates a new object guid handler.ObjectGuidHandler(String attrName)Creates a new object guid handler.ObjectGuidHandler(String attrName, boolean brackets)Creates a new object guid handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapEntryapply(LdapEntry entry)protected StringconvertValue(byte[] value)Converts the supplied binary value to its string form.booleanequals(Object o)booleangetWithBrackets()Returns whether the guid will be enclosed in brackets.inthashCode()ObjectGuidHandlernewInstance()Create a new instance of this message functional.voidsetWithBrackets(boolean brackets)Sets whether to enclose the GUID in brackets.-
Methods inherited from class org.ldaptive.ad.handler.AbstractBinaryAttributeHandler
getAttributeName, handleAttributes, setAttributeName, setRequest
-
Methods inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntry
-
Methods inherited from class org.ldaptive.transport.MessageFunctional
getConnection, getHandle, getRequest, setConnection, setHandle
-
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
-
ATTRIBUTE_NAME
private static final String ATTRIBUTE_NAME
objectGuid attribute name.- See Also:
- Constant Field Values
-
withBrackets
private boolean withBrackets
whether to enclose the guid in brackets.
-
-
Constructor Detail
-
ObjectGuidHandler
public ObjectGuidHandler()
Creates a new object guid handler.
-
ObjectGuidHandler
public ObjectGuidHandler(boolean brackets)
Creates a new object guid handler.- Parameters:
brackets- whether to enclose the GUID in brackets
-
ObjectGuidHandler
public ObjectGuidHandler(String attrName)
Creates a new object guid handler.- Parameters:
attrName- name of the attribute which is encoded as an objectGUID
-
ObjectGuidHandler
public ObjectGuidHandler(String attrName, boolean brackets)
Creates a new object guid handler.- Parameters:
attrName- name of the attribute which is encoded as an objectGUIDbrackets- whether to enclose the GUID in brackets
-
-
Method Detail
-
getWithBrackets
public boolean getWithBrackets()
Returns whether the guid will be enclosed in brackets.- Returns:
- whether the guid will be enclosed in brackets
-
setWithBrackets
public void setWithBrackets(boolean brackets)
Sets whether to enclose the GUID in brackets.- Parameters:
brackets- whether to enclose the GUID in brackets
-
convertValue
protected String convertValue(byte[] value)
Description copied from class:AbstractBinaryAttributeHandlerConverts the supplied binary value to its string form.- Specified by:
convertValuein classAbstractBinaryAttributeHandler<LdapEntry>- Parameters:
value- to convert- Returns:
- string form of the value
-
newInstance
public ObjectGuidHandler newInstance()
Description copied from class:MessageFunctionalCreate a new instance of this message functional.- Specified by:
newInstancein classMessageFunctional<SearchRequest,SearchResponse>- Returns:
- new instance of this message functional
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractBinaryAttributeHandler<LdapEntry>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractBinaryAttributeHandler<LdapEntry>
-
-