Package com.orbitz.consul.model.agent
Class ImmutableMember.Builder
- java.lang.Object
-
- com.orbitz.consul.model.agent.ImmutableMember.Builder
-
- Enclosing class:
- ImmutableMember
@NotThreadSafe public static final class ImmutableMember.Builder extends java.lang.Object
Builds instances of typeImmutableMember
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
Modifier and Type Method Description ImmutableMember.Builder
address(java.lang.String address)
Initializes the value for theaddress
attribute.ImmutableMember
build()
Builds a newImmutableMember
.ImmutableMember.Builder
delegateCur(int delegateCur)
Initializes the value for thedelegateCur
attribute.ImmutableMember.Builder
delegateMax(int delegateMax)
Initializes the value for thedelegateMax
attribute.ImmutableMember.Builder
delegateMin(int delegateMin)
Initializes the value for thedelegateMin
attribute.ImmutableMember.Builder
from(Member instance)
Fill a builder with attribute values from the providedMember
instance.ImmutableMember.Builder
name(java.lang.String name)
Initializes the value for thename
attribute.ImmutableMember.Builder
port(int port)
Initializes the value for theport
attribute.ImmutableMember.Builder
protocolCur(int protocolCur)
Initializes the value for theprotocolCur
attribute.ImmutableMember.Builder
protocolMax(int protocolMax)
Initializes the value for theprotocolMax
attribute.ImmutableMember.Builder
protocolMin(int protocolMin)
Initializes the value for theprotocolMin
attribute.ImmutableMember.Builder
putAllTags(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Put all mappings from the specified map as entries totags
map.ImmutableMember.Builder
putTags(java.lang.String key, java.lang.String value)
Put one entry to thetags
map.ImmutableMember.Builder
putTags(java.util.Map.Entry<java.lang.String,? extends java.lang.String> entry)
Put one entry to thetags
map.ImmutableMember.Builder
status(int status)
Initializes the value for thestatus
attribute.ImmutableMember.Builder
tags(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Sets or replaces all mappings from the specified map as entries for thetags
map.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableMember.Builder from(Member instance)
Fill a builder with attribute values from the providedMember
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableMember.Builder name(java.lang.String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
address
@CanIgnoreReturnValue public final ImmutableMember.Builder address(java.lang.String address)
Initializes the value for theaddress
attribute.- Parameters:
address
- The value for address- Returns:
this
builder for use in a chained invocation
-
port
@CanIgnoreReturnValue public final ImmutableMember.Builder port(int port)
Initializes the value for theport
attribute.- Parameters:
port
- The value for port- Returns:
this
builder for use in a chained invocation
-
putTags
@CanIgnoreReturnValue public final ImmutableMember.Builder putTags(java.lang.String key, java.lang.String value)
Put one entry to thetags
map.- Parameters:
key
- The key in the tags mapvalue
- The associated value in the tags map- Returns:
this
builder for use in a chained invocation
-
putTags
@CanIgnoreReturnValue public final ImmutableMember.Builder putTags(java.util.Map.Entry<java.lang.String,? extends java.lang.String> entry)
Put one entry to thetags
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
tags
@CanIgnoreReturnValue public final ImmutableMember.Builder tags(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Sets or replaces all mappings from the specified map as entries for thetags
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the tags map- Returns:
this
builder for use in a chained invocation
-
putAllTags
@CanIgnoreReturnValue public final ImmutableMember.Builder putAllTags(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Put all mappings from the specified map as entries totags
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the tags map- Returns:
this
builder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableMember.Builder status(int status)
Initializes the value for thestatus
attribute.- Parameters:
status
- The value for status- Returns:
this
builder for use in a chained invocation
-
protocolMin
@CanIgnoreReturnValue public final ImmutableMember.Builder protocolMin(int protocolMin)
Initializes the value for theprotocolMin
attribute.- Parameters:
protocolMin
- The value for protocolMin- Returns:
this
builder for use in a chained invocation
-
protocolMax
@CanIgnoreReturnValue public final ImmutableMember.Builder protocolMax(int protocolMax)
Initializes the value for theprotocolMax
attribute.- Parameters:
protocolMax
- The value for protocolMax- Returns:
this
builder for use in a chained invocation
-
protocolCur
@CanIgnoreReturnValue public final ImmutableMember.Builder protocolCur(int protocolCur)
Initializes the value for theprotocolCur
attribute.- Parameters:
protocolCur
- The value for protocolCur- Returns:
this
builder for use in a chained invocation
-
delegateMin
@CanIgnoreReturnValue public final ImmutableMember.Builder delegateMin(int delegateMin)
Initializes the value for thedelegateMin
attribute.- Parameters:
delegateMin
- The value for delegateMin- Returns:
this
builder for use in a chained invocation
-
delegateMax
@CanIgnoreReturnValue public final ImmutableMember.Builder delegateMax(int delegateMax)
Initializes the value for thedelegateMax
attribute.- Parameters:
delegateMax
- The value for delegateMax- Returns:
this
builder for use in a chained invocation
-
delegateCur
@CanIgnoreReturnValue public final ImmutableMember.Builder delegateCur(int delegateCur)
Initializes the value for thedelegateCur
attribute.- Parameters:
delegateCur
- The value for delegateCur- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableMember build()
Builds a newImmutableMember
.- Returns:
- An immutable instance of Member
- Throws:
java.lang.IllegalStateException
- if any required attributes are missing
-
-