Package com.orbitz.consul.model.agent
Class ImmutableRegistration
- java.lang.Object
-
- com.orbitz.consul.model.agent.Registration
-
- com.orbitz.consul.model.agent.ImmutableRegistration
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableRegistration extends RegistrationImmutable implementation ofRegistration.Use the builder to create immutable instances:
ImmutableRegistration.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableRegistration.BuilderBuilds instances of typeImmutableRegistration.-
Nested classes/interfaces inherited from class com.orbitz.consul.model.agent.Registration
Registration.RegCheck
-
-
Method Summary
Modifier and Type Method Description static ImmutableRegistration.Builderbuilder()Creates a builder forImmutableRegistration.static ImmutableRegistrationcopyOf(Registration instance)Creates an immutable copy of aRegistrationvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableRegistrationthat have equal attribute values.java.util.Optional<java.lang.String>getAddress()java.util.Optional<Registration.RegCheck>getCheck()com.google.common.collect.ImmutableList<Registration.RegCheck>getChecks()java.util.Optional<java.lang.Boolean>getEnableTagOverride()java.lang.StringgetId()com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>getMeta()java.lang.StringgetName()java.util.Optional<java.lang.Integer>getPort()com.google.common.collect.ImmutableList<java.lang.String>getTags()inthashCode()Computes a hash code from attributes:name,id,address,port,check,checks,tags,meta,enableTagOverride.java.lang.StringtoString()Prints the immutable valueRegistrationwith attribute values.ImmutableRegistrationwithAddress(java.lang.String value)Copy the current immutable object by setting a present value for the optionaladdressattribute.ImmutableRegistrationwithAddress(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theaddressattribute.ImmutableRegistrationwithCheck(Registration.RegCheck value)Copy the current immutable object by setting a present value for the optionalcheckattribute.ImmutableRegistrationwithCheck(java.util.Optional<? extends Registration.RegCheck> optional)Copy the current immutable object by setting an optional value for thecheckattribute.ImmutableRegistrationwithChecks(Registration.RegCheck... elements)Copy the current immutable object with elements that replace the content ofchecks.ImmutableRegistrationwithChecks(java.lang.Iterable<? extends Registration.RegCheck> elements)Copy the current immutable object with elements that replace the content ofchecks.ImmutableRegistrationwithEnableTagOverride(boolean value)Copy the current immutable object by setting a present value for the optionalenableTagOverrideattribute.ImmutableRegistrationwithEnableTagOverride(java.util.Optional<java.lang.Boolean> optional)Copy the current immutable object by setting an optional value for theenableTagOverrideattribute.ImmutableRegistrationwithId(java.lang.String value)Copy the current immutable object by setting a value for theidattribute.ImmutableRegistrationwithMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing themetamap with the specified map.ImmutableRegistrationwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableRegistrationwithPort(int value)Copy the current immutable object by setting a present value for the optionalportattribute.ImmutableRegistrationwithPort(java.util.Optional<java.lang.Integer> optional)Copy the current immutable object by setting an optional value for theportattribute.ImmutableRegistrationwithTags(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content oftags.ImmutableRegistrationwithTags(java.lang.String... elements)Copy the current immutable object with elements that replace the content oftags.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein classRegistration- Returns:
- The value of the
nameattribute
-
getId
public java.lang.String getId()
- Specified by:
getIdin classRegistration- Returns:
- The value of the
idattribute
-
getAddress
public java.util.Optional<java.lang.String> getAddress()
- Specified by:
getAddressin classRegistration- Returns:
- The value of the
addressattribute
-
getPort
public java.util.Optional<java.lang.Integer> getPort()
- Specified by:
getPortin classRegistration- Returns:
- The value of the
portattribute
-
getCheck
public java.util.Optional<Registration.RegCheck> getCheck()
- Specified by:
getCheckin classRegistration- Returns:
- The value of the
checkattribute
-
getChecks
public com.google.common.collect.ImmutableList<Registration.RegCheck> getChecks()
- Specified by:
getChecksin classRegistration- Returns:
- The value of the
checksattribute
-
getTags
public com.google.common.collect.ImmutableList<java.lang.String> getTags()
- Specified by:
getTagsin classRegistration- Returns:
- The value of the
tagsattribute
-
getMeta
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getMeta()
- Specified by:
getMetain classRegistration- Returns:
- The value of the
metaattribute
-
getEnableTagOverride
public java.util.Optional<java.lang.Boolean> getEnableTagOverride()
- Specified by:
getEnableTagOverridein classRegistration- Returns:
- The value of the
enableTagOverrideattribute
-
withName
public final ImmutableRegistration withName(java.lang.String value)
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
public final ImmutableRegistration withId(java.lang.String value)
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
public final ImmutableRegistration withAddress(java.lang.String value)
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
public final ImmutableRegistration withAddress(java.util.Optional<java.lang.String> optional)
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
public final ImmutableRegistration withPort(int value)
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
public final ImmutableRegistration withPort(java.util.Optional<java.lang.Integer> optional)
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
public final ImmutableRegistration withCheck(Registration.RegCheck value)
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
public final ImmutableRegistration withCheck(java.util.Optional<? extends Registration.RegCheck> optional)
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
public final ImmutableRegistration withChecks(Registration.RegCheck... elements)
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
public final ImmutableRegistration withChecks(java.lang.Iterable<? extends Registration.RegCheck> elements)
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
public final ImmutableRegistration withTags(java.lang.String... elements)
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
public final ImmutableRegistration withTags(java.lang.Iterable<java.lang.String> elements)
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
public final ImmutableRegistration withMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)
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
public final ImmutableRegistration withEnableTagOverride(boolean value)
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
public final ImmutableRegistration withEnableTagOverride(java.util.Optional<java.lang.Boolean> optional)
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
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableRegistrationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,id,address,port,check,checks,tags,meta,enableTagOverride.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueRegistrationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableRegistration copyOf(Registration instance)
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
public static ImmutableRegistration.Builder builder()
Creates a builder forImmutableRegistration.ImmutableRegistration.builder() .name(String) // requiredname.id(String) // requiredid.address(String) // optionaladdress.port(Integer) // optionalport.check(com.orbitz.consul.model.agent.Registration.RegCheck) // optionalcheck.addChecks|addAllChecks(com.orbitz.consul.model.agent.Registration.RegCheck) //checkselements .addTags|addAllTags(String) //tagselements .putMeta|putAllMeta(String => String) //metamappings .enableTagOverride(Boolean) // optionalenableTagOverride.build();- Returns:
- A new ImmutableRegistration builder
-
-