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 class
SearchResultReference.Builder
protected static class
SearchResultReference.ReferralUriHandler
Parse 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 int
HASH_CODE_SEED
hash code seed.private boolean
immutable
Whether this object has been marked immutable.static int
PROTOCOL_OP
BER protocol number.private List<String>
references
List of references.private static DERPath
REFERRAL_URI_PATH
DER 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 void
addUris(String... uri)
Adds a new URI to this reference.void
addUris(Collection<String> uris)
Adds a new URI to this reference.void
assertMutable()
Asserts that this object is in a state to permit mutations.static SearchResultReference.Builder
builder()
Creates a builder for this class.static SearchResultReference
copy(SearchResultReference ref)
Creates a mutable copy of the supplied search result reference.boolean
equals(Object o)
void
freeze()
Freezes this object, making it immutable.String[]
getUris()
Returns the URIs in this reference.int
hashCode()
Returns the hash code for this object.boolean
isFrozen()
Determines whether this object is frozen, i.e. immutable.void
removeUris(String... uri)
Removes a URI from this reference.void
removeUris(Collection<String> uris)
Removes a URI from this reference.static SearchResultReference
sort(SearchResultReference ref)
Returns a new reference whose URIs are sorted naturally.String
toString()
-
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:Freezable
Freezes this object, making it immutable.
-
isFrozen
public boolean isFrozen()
Description copied from interface:Freezable
Determines whether this object is frozen, i.e. immutable.- Specified by:
isFrozen
in interfaceFreezable
- Returns:
- True if
Freezable.freeze()
has been invoked, false otherwise.
-
assertMutable
public void assertMutable()
Description copied from interface:Freezable
Asserts 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:
assertMutable
in 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:
equals
in classAbstractMessage
-
hashCode
public int hashCode()
Description copied from class:AbstractMessage
Returns the hash code for this object.- Specified by:
hashCode
in classAbstractMessage
- Returns:
- hash code
-
toString
public String toString()
- Overrides:
toString
in 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
-
-