| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableStorage.Builder
Builds instances of type
ImmutableStorage. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableStorage.Builder |
builder()
Creates a builder for
ImmutableStorage. |
static ImmutableStorage |
copyOf(Storage instance)
Creates an immutable copy of a
Storage value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableStorage that have equal attribute values. |
int |
getOplogSize() |
String |
getReplSetName() |
int |
hashCode()
Computes a hash code from attributes:
oplogSize, replSetName. |
String |
toString()
Prints the immutable value
Storage with attribute values. |
ImmutableStorage |
withOplogSize(int value)
Copy the current immutable object by setting a value for the
oplogSize attribute. |
ImmutableStorage |
withReplSetName(String value)
Copy the current immutable object by setting a value for the
replSetName attribute. |
public int getOplogSize()
getOplogSize in class StorageoplogSize attributepublic String getReplSetName()
getReplSetName in class StoragereplSetName attributepublic final ImmutableStorage withOplogSize(int value)
oplogSize attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for oplogSizethis objectpublic final ImmutableStorage withReplSetName(String value)
replSetName attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for replSetNamethis objectpublic boolean equals(Object another)
ImmutableStorage that have equal attribute values.public int hashCode()
oplogSize, replSetName.public String toString()
Storage with attribute values.public static ImmutableStorage copyOf(Storage instance)
Storage 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 ImmutableStorage.Builder builder()
ImmutableStorage.
ImmutableStorage.builder()
.oplogSize(int) // optional oplogSize
.replSetName(String) // required replSetName
.build();
Copyright © 2022. All rights reserved.