Package com.orbitz.consul.model.agent
Class ImmutableMember
- java.lang.Object
-
- com.orbitz.consul.model.agent.Member
-
- com.orbitz.consul.model.agent.ImmutableMember
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableMember.BuilderBuilds instances of typeImmutableMember.
-
Method Summary
Modifier and Type Method Description static ImmutableMember.Builderbuilder()Creates a builder forImmutableMember.static ImmutableMembercopyOf(Member instance)Creates an immutable copy of aMembervalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableMemberthat have equal attribute values.java.lang.StringgetAddress()intgetDelegateCur()intgetDelegateMax()intgetDelegateMin()java.lang.StringgetName()intgetPort()intgetProtocolCur()intgetProtocolMax()intgetProtocolMin()intgetStatus()com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>getTags()inthashCode()Computes a hash code from attributes:name,address,port,tags,status,protocolMin,protocolMax,protocolCur,delegateMin,delegateMax,delegateCur.java.lang.StringtoString()Prints the immutable valueMemberwith attribute values.ImmutableMemberwithAddress(java.lang.String value)Copy the current immutable object by setting a value for theaddressattribute.ImmutableMemberwithDelegateCur(int value)Copy the current immutable object by setting a value for thedelegateCurattribute.ImmutableMemberwithDelegateMax(int value)Copy the current immutable object by setting a value for thedelegateMaxattribute.ImmutableMemberwithDelegateMin(int value)Copy the current immutable object by setting a value for thedelegateMinattribute.ImmutableMemberwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableMemberwithPort(int value)Copy the current immutable object by setting a value for theportattribute.ImmutableMemberwithProtocolCur(int value)Copy the current immutable object by setting a value for theprotocolCurattribute.ImmutableMemberwithProtocolMax(int value)Copy the current immutable object by setting a value for theprotocolMaxattribute.ImmutableMemberwithProtocolMin(int value)Copy the current immutable object by setting a value for theprotocolMinattribute.ImmutableMemberwithStatus(int value)Copy the current immutable object by setting a value for thestatusattribute.ImmutableMemberwithTags(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing thetagsmap with the specified map.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getAddress
public java.lang.String getAddress()
- Specified by:
getAddressin classMember- Returns:
- The value of the
addressattribute
-
getPort
public int getPort()
-
getTags
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getTags()
-
getStatus
public int getStatus()
-
getProtocolMin
public int getProtocolMin()
- Specified by:
getProtocolMinin classMember- Returns:
- The value of the
protocolMinattribute
-
getProtocolMax
public int getProtocolMax()
- Specified by:
getProtocolMaxin classMember- Returns:
- The value of the
protocolMaxattribute
-
getProtocolCur
public int getProtocolCur()
- Specified by:
getProtocolCurin classMember- Returns:
- The value of the
protocolCurattribute
-
getDelegateMin
public int getDelegateMin()
- Specified by:
getDelegateMinin classMember- Returns:
- The value of the
delegateMinattribute
-
getDelegateMax
public int getDelegateMax()
- Specified by:
getDelegateMaxin classMember- Returns:
- The value of the
delegateMaxattribute
-
getDelegateCur
public int getDelegateCur()
- Specified by:
getDelegateCurin classMember- Returns:
- The value of the
delegateCurattribute
-
withName
public final ImmutableMember 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
-
withAddress
public final ImmutableMember withAddress(java.lang.String value)
Copy the current immutable object by setting a value for theaddressattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for address- Returns:
- A modified copy of the
thisobject
-
withPort
public final ImmutableMember withPort(int value)
Copy the current immutable object by setting a value for theportattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for port- Returns:
- A modified copy of the
thisobject
-
withTags
public final ImmutableMember withTags(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Copy the current immutable object by replacing thetagsmap 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 tags map- Returns:
- A modified copy of
thisobject
-
withStatus
public final ImmutableMember withStatus(int value)
Copy the current immutable object by setting a value for thestatusattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for status- Returns:
- A modified copy of the
thisobject
-
withProtocolMin
public final ImmutableMember withProtocolMin(int value)
Copy the current immutable object by setting a value for theprotocolMinattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for protocolMin- Returns:
- A modified copy of the
thisobject
-
withProtocolMax
public final ImmutableMember withProtocolMax(int value)
Copy the current immutable object by setting a value for theprotocolMaxattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for protocolMax- Returns:
- A modified copy of the
thisobject
-
withProtocolCur
public final ImmutableMember withProtocolCur(int value)
Copy the current immutable object by setting a value for theprotocolCurattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for protocolCur- Returns:
- A modified copy of the
thisobject
-
withDelegateMin
public final ImmutableMember withDelegateMin(int value)
Copy the current immutable object by setting a value for thedelegateMinattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for delegateMin- Returns:
- A modified copy of the
thisobject
-
withDelegateMax
public final ImmutableMember withDelegateMax(int value)
Copy the current immutable object by setting a value for thedelegateMaxattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for delegateMax- Returns:
- A modified copy of the
thisobject
-
withDelegateCur
public final ImmutableMember withDelegateCur(int value)
Copy the current immutable object by setting a value for thedelegateCurattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for delegateCur- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableMemberthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,address,port,tags,status,protocolMin,protocolMax,protocolCur,delegateMin,delegateMax,delegateCur.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueMemberwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableMember copyOf(Member instance)
Creates an immutable copy of aMembervalue. 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 Member instance
-
builder
public static ImmutableMember.Builder builder()
Creates a builder forImmutableMember.ImmutableMember.builder() .name(String) // requiredname.address(String) // requiredaddress.port(int) // requiredport.putTags|putAllTags(String => String) //tagsmappings .status(int) // requiredstatus.protocolMin(int) // requiredprotocolMin.protocolMax(int) // requiredprotocolMax.protocolCur(int) // requiredprotocolCur.delegateMin(int) // requireddelegateMin.delegateMax(int) // requireddelegateMax.delegateCur(int) // requireddelegateCur.build();- Returns:
- A new ImmutableMember builder
-
-