public static final class SessionOwnershipRecord.Builder extends Object
Builder of Session Ownership Records.
Modifier and Type | Method and Description |
---|---|
SessionOwnershipRecord.Builder |
addAdditionalKey(String additionalKey)
Add an additional key to the existing set of additional keys for the record to be built.
|
SessionOwnershipRecord.Builder |
addAttribute(String name,
String value)
Add or replace an attribute for the record to be built.
|
SessionOwnershipRecord.Builder |
addOwnerURI(String ownerURI)
Add a session owner URI to the existing set of owner URIs for the record to be built.
|
SessionOwnershipRecord |
build()
Create a new immutable SessionOwnershipRecord based on the current values assigned to this builder.
|
Set<String> |
getAdditionalKeys()
Get the current set of additional keys for the record to be built.
|
String |
getAttribute(String name)
Get the value of the specified attribute from the record to be built.
|
Map<String,String> |
getAttributes()
Get the map of all attributes for the record to be built.
|
Set<String> |
getOwnerURIs()
Get the set of session owner URIs for the record to be built.
|
String |
getPrimaryKey()
Get the primary key of the record to be built.
|
int |
getSequenceNumber()
Get the sequence number for the record to be built.
|
SessionOwnershipRecord.Builder |
overrideSequenceNumber(int sequenceNumber)
Overrides the generated sequence number for the record to be built.
|
SessionOwnershipRecord.Builder |
removeAdditionalKey(String additionalKey)
Remove an additional key from the set of additional keys for the record to be built.
|
SessionOwnershipRecord.Builder |
removeAttribute(String name)
Remove the attribute with the specified name from the map of attributes for the record to be built..
|
SessionOwnershipRecord.Builder |
removeOwnerUri(String ownerURI)
Deprecated.
use
removeOwnerURI(String) instead. |
SessionOwnershipRecord.Builder |
removeOwnerURI(String ownerURI)
Remove a session owner URI from the set of owner URIs for the record to be built..
|
SessionOwnershipRecord.Builder |
setAdditionalKeys(Set<String> additionalKeys)
Set the set of additional keys for the record to be built.
|
SessionOwnershipRecord.Builder |
setAttributes(Map<String,String> attributes)
Set the map of attributes for the record to be built.
|
SessionOwnershipRecord.Builder |
setOwnerURIs(Set<String> ownerURIs)
Set the set of session owner URIs for the record to be built.
|
SessionOwnershipRecord.Builder |
setPrimaryKey(String primaryKey)
Set the primary key for the record to be built.
|
public String getPrimaryKey()
Get the primary key of the record to be built.
public SessionOwnershipRecord.Builder setPrimaryKey(String primaryKey)
Set the primary key for the record to be built.
The primary key cannot be null
.
primaryKey
- the primary key.NullPointerException
- if primaryKey
is null
.public Set<String> getAdditionalKeys()
Get the current set of additional keys for the record to be built. Changes to the returned set will be reflected in this builder.
public SessionOwnershipRecord.Builder setAdditionalKeys(Set<String> additionalKeys)
Set the set of additional keys for the record to be built.
The set may not contain null
elements.
additionalKeys
- a set of additional keys.
This set will replace the set currently maintained by the builder.NullPointerException
- if additionalKeys
is null
.IllegalArgumentException
- if additionalKeys
contains null
.elements.public SessionOwnershipRecord.Builder addAdditionalKey(String additionalKey)
Add an additional key to the existing set of additional keys for the record to be built.
additionalKey
- the additional key to add.NullPointerException
- if additionalKey
is null
.public SessionOwnershipRecord.Builder removeAdditionalKey(String additionalKey)
Remove an additional key from the set of additional keys for the record to be built.
additionalKey
- the additional key to remove.public int getSequenceNumber()
Get the sequence number for the record to be built.
public SessionOwnershipRecord.Builder overrideSequenceNumber(int sequenceNumber)
Overrides the generated sequence number for the record to be built.
Sequence numbers are automatically set when a Builder
is created.
New builders created from SessionOwnershipRecord.newBuilder()
will have a sequence number of 0.
Builders created from existing records using SessionOwnershipRecord.toBuilder()
will have a sequence number one more than the sequence number of the source record.
It is not normally required to replace the generated sequence numbers but this method can be used to do so if necessary.
sequenceNumber
- the new sequence number.public Set<String> getOwnerURIs()
Get the set of session owner URIs for the record to be built. Changes to the returned set will be reflected in this builder.
public SessionOwnershipRecord.Builder setOwnerURIs(Set<String> ownerURIs)
Set the set of session owner URIs for the record to be built.
The set may not contain null
elements.
ownerURIs
- a set of session owner URIs.
This set will replace the set currently maintained by the builder.NullPointerException
- if ownerURIs
is null
.IllegalArgumentException
- if ownerURIs
contains null
.elements.public SessionOwnershipRecord.Builder addOwnerURI(String ownerURI)
Add a session owner URI to the existing set of owner URIs for the record to be built.
ownerURI
- the session owner URI to be added.NullPointerException
- if ownerURI
is null
.@Deprecated public SessionOwnershipRecord.Builder removeOwnerUri(String ownerURI)
removeOwnerURI(String)
instead.Remove a session owner URI from the set of owner URIs for the record to be built..
ownerURI
- the session owner URI to remove.public SessionOwnershipRecord.Builder removeOwnerURI(String ownerURI)
Remove a session owner URI from the set of owner URIs for the record to be built..
ownerURI
- the session owner URI to remove.public Map<String,String> getAttributes()
Get the map of all attributes for the record to be built. Changes to the returned map will be reflected in this builder.
public String getAttribute(String name)
Get the value of the specified attribute from the record to be built.
name
- the attribute name.null
if no such attribute exists.public SessionOwnershipRecord.Builder setAttributes(Map<String,String> attributes)
Set the map of attributes for the record to be built.
The map may not contain null
keys or values.
attributes
- a map of attribute name to attribute value.
This map will replace the map currently maintained by the builder.NullPointerException
- if attributes
is null
.IllegalArgumentException
- if attributes
contains null
.keys or values.public SessionOwnershipRecord.Builder addAttribute(String name, String value)
Add or replace an attribute for the record to be built.
name
- the name of the attribute.value
- the attribute’s value.NullPointerException
- if name
or value
is null
.public SessionOwnershipRecord.Builder removeAttribute(String name)
Remove the attribute with the specified name from the map of attributes for the record to be built..
name
- the name of the attribute to remove.public SessionOwnershipRecord build()
Create a new immutable SessionOwnershipRecord based on the current values assigned to this builder.
SessionOwnershipRecord
with the values from this builder.IllegalStateException
- if the set of additional keys or owner URIs contains contain a null
value, or if the map of attributes contain a null
key or value.