public final class ImmutableRole extends Object implements AuthenticationSetup.Role
AuthenticationSetup.Role.
Use the builder to create immutable instances:
ImmutableRole.builder().
Use the static factory method to create immutable instances:
ImmutableRole.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableRole.Builder
Builds instances of type
ImmutableRole. |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
actions() |
static ImmutableRole.Builder |
builder()
Creates a builder for
ImmutableRole. |
String |
collection() |
static ImmutableRole |
copyOf(AuthenticationSetup.Role instance)
Creates an immutable copy of a
AuthenticationSetup.Role value. |
String |
database() |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableRole that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
database, collection, name, actions. |
String |
name() |
static ImmutableRole |
of(String database,
String collection,
String name)
Construct a new immutable
Role instance. |
String |
toString()
Prints the immutable value
Role with attribute values. |
ImmutableRole |
withActions(Iterable<String> elements)
Copy the current immutable object with elements that replace the content of
actions. |
ImmutableRole |
withActions(String... elements)
Copy the current immutable object with elements that replace the content of
actions. |
ImmutableRole |
withCollection(String value)
Copy the current immutable object by setting a value for the
collection attribute. |
ImmutableRole |
withDatabase(String value)
Copy the current immutable object by setting a value for the
database attribute. |
ImmutableRole |
withName(String value)
Copy the current immutable object by setting a value for the
name attribute. |
public String database()
database in interface AuthenticationSetup.Roledatabase attributepublic String collection()
collection in interface AuthenticationSetup.Rolecollection attributepublic String name()
name in interface AuthenticationSetup.Rolename attributepublic List<String> actions()
actions in interface AuthenticationSetup.Roleactions attributepublic final ImmutableRole withDatabase(String value)
database attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for databasethis objectpublic final ImmutableRole withCollection(String value)
collection attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for collectionthis objectpublic final ImmutableRole withName(String value)
name attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for namethis objectpublic final ImmutableRole withActions(String... elements)
actions.elements - The elements to setthis objectpublic final ImmutableRole withActions(Iterable<String> elements)
actions.
A shallow reference equality check is used to prevent copying of the same value by returning this.elements - An iterable of actions elements to setthis objectpublic boolean equals(Object another)
ImmutableRole that have equal attribute values.public int hashCode()
database, collection, name, actions.public String toString()
Role with attribute values.public static ImmutableRole of(String database, String collection, String name)
Role instance.database - The value for the database attributecollection - The value for the collection attributename - The value for the name attributepublic static ImmutableRole copyOf(AuthenticationSetup.Role instance)
AuthenticationSetup.Role value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableRole.Builder builder()
ImmutableRole.
ImmutableRole.builder()
.database(String) // required database
.collection(String) // required collection
.name(String) // required name
.addActions|addAllActions(String) // actions elements
.build();
Copyright © 2023. All rights reserved.