Class ImmutableMember
java.lang.Object
org.kiwiproject.consul.model.agent.Member
org.kiwiproject.consul.model.agent.ImmutableMember
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMember
extends Member
Immutable implementation of
Member.
Use the builder to create immutable instances:
ImmutableMember.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableMember.Builderbuilder()Creates a builder forImmutableMember.static ImmutableMemberCreates an immutable copy of aMembervalue.booleanThis instance is equal to all instances ofImmutableMemberthat have equal attribute values.intintintgetName()intgetPort()intintintintgetTags()inthashCode()Computes a hash code from attributes:name,address,port,tags,status,protocolMin,protocolMax,protocolCur,delegateMin,delegateMax,delegateCur.toString()Prints the immutable valueMemberwith attribute values.final ImmutableMemberwithAddress(String value) Copy the current immutable object by setting a value for theaddressattribute.final ImmutableMemberwithDelegateCur(int value) Copy the current immutable object by setting a value for thedelegateCurattribute.final ImmutableMemberwithDelegateMax(int value) Copy the current immutable object by setting a value for thedelegateMaxattribute.final ImmutableMemberwithDelegateMin(int value) Copy the current immutable object by setting a value for thedelegateMinattribute.final ImmutableMemberCopy the current immutable object by setting a value for thenameattribute.final ImmutableMemberwithPort(int value) Copy the current immutable object by setting a value for theportattribute.final ImmutableMemberwithProtocolCur(int value) Copy the current immutable object by setting a value for theprotocolCurattribute.final ImmutableMemberwithProtocolMax(int value) Copy the current immutable object by setting a value for theprotocolMaxattribute.final ImmutableMemberwithProtocolMin(int value) Copy the current immutable object by setting a value for theprotocolMinattribute.final ImmutableMemberwithStatus(int value) Copy the current immutable object by setting a value for thestatusattribute.final ImmutableMemberCopy the current immutable object by replacing thetagsmap with the specified map.
-
Method Details
-
getName
-
getAddress
- Specified by:
getAddressin classMember- Returns:
- The value of the
addressattribute
-
getPort
public int getPort() -
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
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
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
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
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
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
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
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
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
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
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
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
This instance is equal to all instances ofImmutableMemberthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,address,port,tags,status,protocolMin,protocolMax,protocolCur,delegateMin,delegateMax,delegateCur. -
toString
Prints the immutable valueMemberwith attribute values. -
copyOf
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
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
-