Package com.orbitz.consul.model.agent
Class ImmutableConfig
- java.lang.Object
-
- com.orbitz.consul.model.agent.Config
-
- com.orbitz.consul.model.agent.ImmutableConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableConfig.BuilderBuilds instances of typeImmutableConfig.
-
Method Summary
Modifier and Type Method Description static ImmutableConfig.Builderbuilder()Creates a builder forImmutableConfig.static ImmutableConfigcopyOf(Config instance)Creates an immutable copy of aConfigvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableConfigthat have equal attribute values.java.lang.StringgetDatacenter()java.lang.StringgetNodeName()java.lang.StringgetRevision()booleangetServer()java.lang.StringgetVersion()inthashCode()Computes a hash code from attributes:datacenter,nodeName,revision,server,version.java.lang.StringtoString()Prints the immutable valueConfigwith attribute values.ImmutableConfigwithDatacenter(java.lang.String value)Copy the current immutable object by setting a value for thedatacenterattribute.ImmutableConfigwithNodeName(java.lang.String value)Copy the current immutable object by setting a value for thenodeNameattribute.ImmutableConfigwithRevision(java.lang.String value)Copy the current immutable object by setting a value for therevisionattribute.ImmutableConfigwithServer(boolean value)Copy the current immutable object by setting a value for theserverattribute.ImmutableConfigwithVersion(java.lang.String value)Copy the current immutable object by setting a value for theversionattribute.
-
-
-
Method Detail
-
getDatacenter
public java.lang.String getDatacenter()
- Specified by:
getDatacenterin classConfig- Returns:
- The value of the
datacenterattribute
-
getNodeName
public java.lang.String getNodeName()
- Specified by:
getNodeNamein classConfig- Returns:
- The value of the
nodeNameattribute
-
getRevision
public java.lang.String getRevision()
- Specified by:
getRevisionin classConfig- Returns:
- The value of the
revisionattribute
-
getServer
public boolean getServer()
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersionin classConfig- Returns:
- The value of the
versionattribute
-
withDatacenter
public final ImmutableConfig withDatacenter(java.lang.String value)
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
public final ImmutableConfig withNodeName(java.lang.String value)
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
public final ImmutableConfig withRevision(java.lang.String value)
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
public final ImmutableConfig withServer(boolean value)
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
public final ImmutableConfig withVersion(java.lang.String value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableConfigthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:datacenter,nodeName,revision,server,version.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueConfigwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableConfig copyOf(Config instance)
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
public static ImmutableConfig.Builder 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
-
-