Class ImmutableRegistration
java.lang.Object
org.kiwiproject.consul.model.agent.Registration
org.kiwiproject.consul.model.agent.ImmutableRegistration
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableRegistration
extends Registration
Immutable implementation of
Registration.
Use the builder to create immutable instances:
ImmutableRegistration.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableRegistration.Nested classes/interfaces inherited from class org.kiwiproject.consul.model.agent.Registration
Registration.RegCheck -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableRegistration.static ImmutableRegistrationcopyOf(Registration instance) Creates an immutable copy of aRegistrationvalue.booleanThis instance is equal to all instances ofImmutableRegistrationthat have equal attribute values.getCheck()com.google.common.collect.ImmutableList<Registration.RegCheck>getId()getMeta()getName()getPort()com.google.common.collect.ImmutableList<String>getTags()inthashCode()Computes a hash code from attributes:name,id,address,port,check,checks,tags,meta,enableTagOverride,serviceWeights.toString()Prints the immutable valueRegistrationwith attribute values.final ImmutableRegistrationwithAddress(String value) Copy the current immutable object by setting a present value for the optionaladdressattribute.final ImmutableRegistrationwithAddress(Optional<String> optional) Copy the current immutable object by setting an optional value for theaddressattribute.final ImmutableRegistrationwithCheck(Optional<? extends Registration.RegCheck> optional) Copy the current immutable object by setting an optional value for thecheckattribute.final ImmutableRegistrationwithCheck(Registration.RegCheck value) Copy the current immutable object by setting a present value for the optionalcheckattribute.final ImmutableRegistrationwithChecks(Iterable<? extends Registration.RegCheck> elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableRegistrationwithChecks(Registration.RegCheck... elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableRegistrationwithEnableTagOverride(boolean value) Copy the current immutable object by setting a present value for the optionalenableTagOverrideattribute.final ImmutableRegistrationwithEnableTagOverride(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theenableTagOverrideattribute.final ImmutableRegistrationCopy the current immutable object by setting a value for theidattribute.final ImmutableRegistrationCopy the current immutable object by replacing themetamap with the specified map.final ImmutableRegistrationCopy the current immutable object by setting a value for thenameattribute.final ImmutableRegistrationwithPort(int value) Copy the current immutable object by setting a present value for the optionalportattribute.final ImmutableRegistrationCopy the current immutable object by setting an optional value for theportattribute.final ImmutableRegistrationwithServiceWeights(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theserviceWeightsattribute.final ImmutableRegistrationwithServiceWeights(ServiceWeights value) Copy the current immutable object by setting a present value for the optionalserviceWeightsattribute.final ImmutableRegistrationCopy the current immutable object with elements that replace the content oftags.final ImmutableRegistrationCopy the current immutable object with elements that replace the content oftags.
-
Method Details
-
getName
- Specified by:
getNamein classRegistration- Returns:
- The value of the
nameattribute
-
getId
- Specified by:
getIdin classRegistration- Returns:
- The value of the
idattribute
-
getAddress
- Specified by:
getAddressin classRegistration- Returns:
- The value of the
addressattribute
-
getPort
- Specified by:
getPortin classRegistration- Returns:
- The value of the
portattribute
-
getCheck
- Specified by:
getCheckin classRegistration- Returns:
- The value of the
checkattribute
-
getChecks
- Specified by:
getChecksin classRegistration- Returns:
- The value of the
checksattribute
-
getTags
- Specified by:
getTagsin classRegistration- Returns:
- The value of the
tagsattribute
-
getMeta
- Specified by:
getMetain classRegistration- Returns:
- The value of the
metaattribute
-
getEnableTagOverride
- Specified by:
getEnableTagOverridein classRegistration- Returns:
- The value of the
enableTagOverrideattribute
-
getServiceWeights
- Specified by:
getServiceWeightsin classRegistration- Returns:
- The value of the
serviceWeightsattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withAddress
Copy the current immutable object by setting a present value for the optionaladdressattribute.- Parameters:
value- The value for address- Returns:
- A modified copy of
thisobject
-
withAddress
Copy the current immutable object by setting an optional value for theaddressattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for address- Returns:
- A modified copy of
thisobject
-
withPort
Copy the current immutable object by setting a present value for the optionalportattribute.- Parameters:
value- The value for port- Returns:
- A modified copy of
thisobject
-
withPort
Copy the current immutable object by setting an optional value for theportattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for port- Returns:
- A modified copy of
thisobject
-
withCheck
Copy the current immutable object by setting a present value for the optionalcheckattribute.- Parameters:
value- The value for check- Returns:
- A modified copy of
thisobject
-
withCheck
Copy the current immutable object by setting an optional value for thecheckattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for check- Returns:
- A modified copy of
thisobject
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of checks elements to set- Returns:
- A modified copy of
thisobject
-
withTags
Copy the current immutable object with elements that replace the content oftags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTags
Copy the current immutable object with elements that replace the content oftags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of tags elements to set- Returns:
- A modified copy of
thisobject
-
withMeta
Copy the current immutable object by replacing themetamap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the meta map- Returns:
- A modified copy of
thisobject
-
withEnableTagOverride
Copy the current immutable object by setting a present value for the optionalenableTagOverrideattribute.- Parameters:
value- The value for enableTagOverride- Returns:
- A modified copy of
thisobject
-
withEnableTagOverride
Copy the current immutable object by setting an optional value for theenableTagOverrideattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for enableTagOverride- Returns:
- A modified copy of
thisobject
-
withServiceWeights
Copy the current immutable object by setting a present value for the optionalserviceWeightsattribute.- Parameters:
value- The value for serviceWeights- Returns:
- A modified copy of
thisobject
-
withServiceWeights
Copy the current immutable object by setting an optional value for theserviceWeightsattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for serviceWeights- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableRegistrationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,id,address,port,check,checks,tags,meta,enableTagOverride,serviceWeights. -
toString
Prints the immutable valueRegistrationwith attribute values. -
copyOf
Creates an immutable copy of aRegistrationvalue. 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 Registration instance
-
builder
Creates a builder forImmutableRegistration.ImmutableRegistration.builder() .name(String) // requiredname.id(String) // requiredid.address(String) // optionaladdress.port(Integer) // optionalport.check(org.kiwiproject.consul.model.agent.Registration.RegCheck) // optionalcheck.addChecks|addAllChecks(org.kiwiproject.consul.model.agent.Registration.RegCheck) //checkselements .addTags|addAllTags(String) //tagselements .putMeta|putAllMeta(String => String) //metamappings .enableTagOverride(Boolean) // optionalenableTagOverride.serviceWeights(org.kiwiproject.consul.model.catalog.ServiceWeights) // optionalserviceWeights.build();- Returns:
- A new ImmutableRegistration builder
-