Package org.ldaptive
Class SearchResultReference
- java.lang.Object
-
- org.ldaptive.AbstractMessage
-
- org.ldaptive.SearchResultReference
-
public final class SearchResultReference extends AbstractMessage implements Freezable
LDAP search result entry defined as:SearchResultReference ::= [APPLICATION 19] SEQUENCE SIZE (1..MAX) OF uri URI
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSearchResultReference.Builderprotected static classSearchResultReference.ReferralUriHandlerParse handler implementation for the referral URL.-
Nested classes/interfaces inherited from class org.ldaptive.AbstractMessage
AbstractMessage.AbstractBuilder<B,T extends AbstractMessage>, AbstractMessage.ControlParser, AbstractMessage.ControlsHandler, AbstractMessage.MessageIDHandler
-
-
Field Summary
Fields Modifier and Type Field Description private static intHASH_CODE_SEEDhash code seed.private booleanimmutableWhether this object has been marked immutable.static intPROTOCOL_OPBER protocol number.private List<String>referencesList of references.private static DERPathREFERRAL_URI_PATHDER path to referral URI.
-
Constructor Summary
Constructors Constructor Description SearchResultReference()Default constructor.SearchResultReference(DERBuffer buffer)Creates a new search result reference.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUris(String... uri)Adds a new URI to this reference.voidaddUris(Collection<String> uris)Adds a new URI to this reference.voidassertMutable()Asserts that this object is in a state to permit mutations.static SearchResultReference.Builderbuilder()Creates a builder for this class.static SearchResultReferencecopy(SearchResultReference ref)Creates a mutable copy of the supplied search result reference.booleanequals(Object o)voidfreeze()Freezes this object, making it immutable.String[]getUris()Returns the URIs in this reference.inthashCode()Returns the hash code for this object.booleanisFrozen()Determines whether this object is frozen, i.e. immutable.voidremoveUris(String... uri)Removes a URI from this reference.voidremoveUris(Collection<String> uris)Removes a URI from this reference.static SearchResultReferencesort(SearchResultReference ref)Returns a new reference whose URIs are sorted naturally.StringtoString()-
Methods inherited from class org.ldaptive.AbstractMessage
addControls, copyValues, equalsMessage, getControls, getMessageID, setMessageID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.Message
getControl
-
-
-
-
Field Detail
-
PROTOCOL_OP
public static final int PROTOCOL_OP
BER protocol number.- See Also:
- Constant Field Values
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
REFERRAL_URI_PATH
private static final DERPath REFERRAL_URI_PATH
DER path to referral URI.
-
immutable
private volatile boolean immutable
Whether this object has been marked immutable.
-
-
Constructor Detail
-
SearchResultReference
public SearchResultReference()
Default constructor.
-
SearchResultReference
public SearchResultReference(DERBuffer buffer)
Creates a new search result reference.- Parameters:
buffer- to decode
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:FreezableFreezes this object, making it immutable.
-
isFrozen
public boolean isFrozen()
Description copied from interface:FreezableDetermines whether this object is frozen, i.e. immutable.- Specified by:
isFrozenin interfaceFreezable- Returns:
- True if
Freezable.freeze()has been invoked, false otherwise.
-
assertMutable
public void assertMutable()
Description copied from interface:FreezableAsserts that this object is in a state to permit mutations. Classes that implement this interface should invoke this method prior to performing any mutation of internal state as a means of implementing the "frozen" usage contract.- Specified by:
assertMutablein interfaceFreezable
-
getUris
public String[] getUris()
Returns the URIs in this reference.- Returns:
- reference URIs
-
addUris
public void addUris(String... uri)
Adds a new URI to this reference.- Parameters:
uri- to add
-
addUris
public void addUris(Collection<String> uris)
Adds a new URI to this reference.- Parameters:
uris- to add
-
removeUris
public void removeUris(String... uri)
Removes a URI from this reference.- Parameters:
uri- to remove
-
removeUris
public void removeUris(Collection<String> uris)
Removes a URI from this reference.- Parameters:
uris- to remove
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractMessage
-
hashCode
public int hashCode()
Description copied from class:AbstractMessageReturns the hash code for this object.- Specified by:
hashCodein classAbstractMessage- Returns:
- hash code
-
toString
public String toString()
- Overrides:
toStringin classAbstractMessage
-
copy
public static SearchResultReference copy(SearchResultReference ref)
Creates a mutable copy of the supplied search result reference.- Parameters:
ref- to copy- Returns:
- new search result reference instance
-
sort
public static SearchResultReference sort(SearchResultReference ref)
Returns a new reference whose URIs are sorted naturally.- Parameters:
ref- reference to sort- Returns:
- sorted reference
-
builder
public static SearchResultReference.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-