Package com.orbitz.consul.model.agent
Class ImmutableServiceProxy
- java.lang.Object
-
- com.orbitz.consul.model.agent.ServiceProxy
-
- com.orbitz.consul.model.agent.ImmutableServiceProxy
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableServiceProxy extends ServiceProxyImmutable implementation ofServiceProxy.Use the builder to create immutable instances:
ImmutableServiceProxy.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableServiceProxy.BuilderBuilds instances of typeImmutableServiceProxy.
-
Method Summary
Modifier and Type Method Description static ImmutableServiceProxy.Builderbuilder()Creates a builder forImmutableServiceProxy.static ImmutableServiceProxycopyOf(ServiceProxy instance)Creates an immutable copy of aServiceProxyvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableServiceProxythat have equal attribute values.com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>getConfig()java.lang.StringgetDestinationServiceId()java.lang.StringgetDestinationServiceName()java.lang.StringgetLocalServiceAddress()intgetLocalServicePort()com.google.common.collect.ImmutableList<ServiceProxyUpstream>getUpstreams()inthashCode()Computes a hash code from attributes:destinationServiceName,destinationServiceId,localServiceAddress,localServicePort,config,upstreams.java.lang.StringtoString()Prints the immutable valueServiceProxywith attribute values.ImmutableServiceProxywithConfig(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing theconfigmap with the specified map.ImmutableServiceProxywithDestinationServiceId(java.lang.String value)Copy the current immutable object by setting a value for thedestinationServiceIdattribute.ImmutableServiceProxywithDestinationServiceName(java.lang.String value)Copy the current immutable object by setting a value for thedestinationServiceNameattribute.ImmutableServiceProxywithLocalServiceAddress(java.lang.String value)Copy the current immutable object by setting a value for thelocalServiceAddressattribute.ImmutableServiceProxywithLocalServicePort(int value)Copy the current immutable object by setting a value for thelocalServicePortattribute.ImmutableServiceProxywithUpstreams(ServiceProxyUpstream... elements)Copy the current immutable object with elements that replace the content ofupstreams.ImmutableServiceProxywithUpstreams(java.lang.Iterable<? extends ServiceProxyUpstream> elements)Copy the current immutable object with elements that replace the content ofupstreams.
-
-
-
Method Detail
-
getDestinationServiceName
public java.lang.String getDestinationServiceName()
- Specified by:
getDestinationServiceNamein classServiceProxy- Returns:
- The value of the
destinationServiceNameattribute
-
getDestinationServiceId
public java.lang.String getDestinationServiceId()
- Specified by:
getDestinationServiceIdin classServiceProxy- Returns:
- The value of the
destinationServiceIdattribute
-
getLocalServiceAddress
public java.lang.String getLocalServiceAddress()
- Specified by:
getLocalServiceAddressin classServiceProxy- Returns:
- The value of the
localServiceAddressattribute
-
getLocalServicePort
public int getLocalServicePort()
- Specified by:
getLocalServicePortin classServiceProxy- Returns:
- The value of the
localServicePortattribute
-
getConfig
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getConfig()
- Specified by:
getConfigin classServiceProxy- Returns:
- The value of the
configattribute
-
getUpstreams
public com.google.common.collect.ImmutableList<ServiceProxyUpstream> getUpstreams()
- Specified by:
getUpstreamsin classServiceProxy- Returns:
- The value of the
upstreamsattribute
-
withDestinationServiceName
public final ImmutableServiceProxy withDestinationServiceName(java.lang.String value)
Copy the current immutable object by setting a value for thedestinationServiceNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for destinationServiceName- Returns:
- A modified copy of the
thisobject
-
withDestinationServiceId
public final ImmutableServiceProxy withDestinationServiceId(java.lang.String value)
Copy the current immutable object by setting a value for thedestinationServiceIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for destinationServiceId- Returns:
- A modified copy of the
thisobject
-
withLocalServiceAddress
public final ImmutableServiceProxy withLocalServiceAddress(java.lang.String value)
Copy the current immutable object by setting a value for thelocalServiceAddressattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for localServiceAddress- Returns:
- A modified copy of the
thisobject
-
withLocalServicePort
public final ImmutableServiceProxy withLocalServicePort(int value)
Copy the current immutable object by setting a value for thelocalServicePortattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for localServicePort- Returns:
- A modified copy of the
thisobject
-
withConfig
public final ImmutableServiceProxy withConfig(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Copy the current immutable object by replacing theconfigmap 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 config map- Returns:
- A modified copy of
thisobject
-
withUpstreams
public final ImmutableServiceProxy withUpstreams(ServiceProxyUpstream... elements)
Copy the current immutable object with elements that replace the content ofupstreams.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withUpstreams
public final ImmutableServiceProxy withUpstreams(java.lang.Iterable<? extends ServiceProxyUpstream> elements)
Copy the current immutable object with elements that replace the content ofupstreams. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of upstreams elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableServiceProxythat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:destinationServiceName,destinationServiceId,localServiceAddress,localServicePort,config,upstreams.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueServiceProxywith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableServiceProxy copyOf(ServiceProxy instance)
Creates an immutable copy of aServiceProxyvalue. 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 ServiceProxy instance
-
builder
public static ImmutableServiceProxy.Builder builder()
Creates a builder forImmutableServiceProxy.ImmutableServiceProxy.builder() .destinationServiceName(String) // requireddestinationServiceName.destinationServiceId(String) // requireddestinationServiceId.localServiceAddress(String) // requiredlocalServiceAddress.localServicePort(int) // requiredlocalServicePort.putConfig|putAllConfig(String => String) //configmappings .addUpstreams|addAllUpstreams(com.orbitz.consul.model.agent.ServiceProxyUpstream) //upstreamselements .build();- Returns:
- A new ImmutableServiceProxy builder
-
-