Class ImmutableConfig
java.lang.Object
org.kiwiproject.consul.model.agent.Config
org.kiwiproject.consul.model.agent.ImmutableConfig
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableConfig
extends Config
Immutable implementation of
Config.
Use the builder to create immutable instances:
ImmutableConfig.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableConfig.Builderbuilder()Creates a builder forImmutableConfig.static ImmutableConfigCreates an immutable copy of aConfigvalue.booleanThis instance is equal to all instances ofImmutableConfigthat have equal attribute values.booleaninthashCode()Computes a hash code from attributes:datacenter,nodeName,revision,server,version.toString()Prints the immutable valueConfigwith attribute values.final ImmutableConfigwithDatacenter(String value) Copy the current immutable object by setting a value for thedatacenterattribute.final ImmutableConfigwithNodeName(String value) Copy the current immutable object by setting a value for thenodeNameattribute.final ImmutableConfigwithRevision(String value) Copy the current immutable object by setting a value for therevisionattribute.final ImmutableConfigwithServer(boolean value) Copy the current immutable object by setting a value for theserverattribute.final ImmutableConfigwithVersion(String value) Copy the current immutable object by setting a value for theversionattribute.
-
Method Details
-
getDatacenter
- Specified by:
getDatacenterin classConfig- Returns:
- The value of the
datacenterattribute
-
getNodeName
- Specified by:
getNodeNamein classConfig- Returns:
- The value of the
nodeNameattribute
-
getRevision
- Specified by:
getRevisionin classConfig- Returns:
- The value of the
revisionattribute
-
getServer
public boolean getServer() -
getVersion
- Specified by:
getVersionin classConfig- Returns:
- The value of the
versionattribute
-
withDatacenter
Copy the current immutable object by setting a value for thedatacenterattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for datacenter- Returns:
- A modified copy of the
thisobject
-
withNodeName
Copy the current immutable object by setting a value for thenodeNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for nodeName- Returns:
- A modified copy of the
thisobject
-
withRevision
Copy the current immutable object by setting a value for therevisionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for revision- Returns:
- A modified copy of the
thisobject
-
withServer
Copy the current immutable object by setting a value for theserverattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for server- Returns:
- A modified copy of the
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableConfigthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:datacenter,nodeName,revision,server,version. -
toString
Prints the immutable valueConfigwith attribute values. -
copyOf
Creates an immutable copy of aConfigvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Config instance
-
builder
Creates a builder forImmutableConfig.ImmutableConfig.builder() .datacenter(String) // requireddatacenter.nodeName(String) // requirednodeName.revision(String) // requiredrevision.server(boolean) // requiredserver.version(String) // requiredversion.build();- Returns:
- A new ImmutableConfig builder
-