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.ObjectBuilds instances of typeImmutableMember. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis 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.Builderaddress(java.lang.String address)Initializes the value for theaddressattribute.ImmutableMemberbuild()Builds a newImmutableMember.ImmutableMember.BuilderdelegateCur(int delegateCur)Initializes the value for thedelegateCurattribute.ImmutableMember.BuilderdelegateMax(int delegateMax)Initializes the value for thedelegateMaxattribute.ImmutableMember.BuilderdelegateMin(int delegateMin)Initializes the value for thedelegateMinattribute.ImmutableMember.Builderfrom(Member instance)Fill a builder with attribute values from the providedMemberinstance.ImmutableMember.Buildername(java.lang.String name)Initializes the value for thenameattribute.ImmutableMember.Builderport(int port)Initializes the value for theportattribute.ImmutableMember.BuilderprotocolCur(int protocolCur)Initializes the value for theprotocolCurattribute.ImmutableMember.BuilderprotocolMax(int protocolMax)Initializes the value for theprotocolMaxattribute.ImmutableMember.BuilderprotocolMin(int protocolMin)Initializes the value for theprotocolMinattribute.ImmutableMember.BuilderputAllTags(java.util.Map<java.lang.String,? extends java.lang.String> entries)Put all mappings from the specified map as entries totagsmap.ImmutableMember.BuilderputTags(java.lang.String key, java.lang.String value)Put one entry to thetagsmap.ImmutableMember.BuilderputTags(java.util.Map.Entry<java.lang.String,? extends java.lang.String> entry)Put one entry to thetagsmap.ImmutableMember.Builderstatus(int status)Initializes the value for thestatusattribute.ImmutableMember.Buildertags(java.util.Map<java.lang.String,? extends java.lang.String> entries)Sets or replaces all mappings from the specified map as entries for thetagsmap.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableMember.Builder from(Member instance)
Fill a builder with attribute values from the providedMemberinstance. 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:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableMember.Builder name(java.lang.String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
address
@CanIgnoreReturnValue public final ImmutableMember.Builder address(java.lang.String address)
Initializes the value for theaddressattribute.- Parameters:
address- The value for address- Returns:
thisbuilder for use in a chained invocation
-
port
@CanIgnoreReturnValue public final ImmutableMember.Builder port(int port)
Initializes the value for theportattribute.- Parameters:
port- The value for port- Returns:
thisbuilder 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 thetagsmap.- Parameters:
key- The key in the tags mapvalue- The associated value in the tags map- Returns:
thisbuilder 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 thetagsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 thetagsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the tags map- Returns:
thisbuilder 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 totagsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the tags map- Returns:
thisbuilder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableMember.Builder status(int status)
Initializes the value for thestatusattribute.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
protocolMin
@CanIgnoreReturnValue public final ImmutableMember.Builder protocolMin(int protocolMin)
Initializes the value for theprotocolMinattribute.- Parameters:
protocolMin- The value for protocolMin- Returns:
thisbuilder for use in a chained invocation
-
protocolMax
@CanIgnoreReturnValue public final ImmutableMember.Builder protocolMax(int protocolMax)
Initializes the value for theprotocolMaxattribute.- Parameters:
protocolMax- The value for protocolMax- Returns:
thisbuilder for use in a chained invocation
-
protocolCur
@CanIgnoreReturnValue public final ImmutableMember.Builder protocolCur(int protocolCur)
Initializes the value for theprotocolCurattribute.- Parameters:
protocolCur- The value for protocolCur- Returns:
thisbuilder for use in a chained invocation
-
delegateMin
@CanIgnoreReturnValue public final ImmutableMember.Builder delegateMin(int delegateMin)
Initializes the value for thedelegateMinattribute.- Parameters:
delegateMin- The value for delegateMin- Returns:
thisbuilder for use in a chained invocation
-
delegateMax
@CanIgnoreReturnValue public final ImmutableMember.Builder delegateMax(int delegateMax)
Initializes the value for thedelegateMaxattribute.- Parameters:
delegateMax- The value for delegateMax- Returns:
thisbuilder for use in a chained invocation
-
delegateCur
@CanIgnoreReturnValue public final ImmutableMember.Builder delegateCur(int delegateCur)
Initializes the value for thedelegateCurattribute.- Parameters:
delegateCur- The value for delegateCur- Returns:
thisbuilder 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
-
-