Class ImmutableMember.Builder
java.lang.Object
org.kiwiproject.consul.model.agent.ImmutableMember.Builder
- Enclosing class:
- ImmutableMember
Builds instances of type
ImmutableMember.
Initialize attributes and then invoke the build() 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 TypeMethodDescriptionfinal ImmutableMember.BuilderInitializes the value for theaddressattribute.build()Builds a newImmutableMember.final ImmutableMember.BuilderdelegateCur(int delegateCur) Initializes the value for thedelegateCurattribute.final ImmutableMember.BuilderdelegateMax(int delegateMax) Initializes the value for thedelegateMaxattribute.final ImmutableMember.BuilderdelegateMin(int delegateMin) Initializes the value for thedelegateMinattribute.final ImmutableMember.BuilderFill a builder with attribute values from the providedMemberinstance.final ImmutableMember.BuilderInitializes the value for thenameattribute.final ImmutableMember.Builderport(int port) Initializes the value for theportattribute.final ImmutableMember.BuilderprotocolCur(int protocolCur) Initializes the value for theprotocolCurattribute.final ImmutableMember.BuilderprotocolMax(int protocolMax) Initializes the value for theprotocolMaxattribute.final ImmutableMember.BuilderprotocolMin(int protocolMin) Initializes the value for theprotocolMinattribute.final ImmutableMember.BuilderputAllTags(Map<String, ? extends String> entries) Put all mappings from the specified map as entries totagsmap.final ImmutableMember.BuilderPut one entry to thetagsmap.final ImmutableMember.BuilderPut one entry to thetagsmap.final ImmutableMember.Builderstatus(int status) Initializes the value for thestatusattribute.final ImmutableMember.BuilderSets or replaces all mappings from the specified map as entries for thetagsmap.
-
Method Details
-
from
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
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
address
Initializes the value for theaddressattribute.- Parameters:
address- The value for address- Returns:
thisbuilder for use in a chained invocation
-
port
Initializes the value for theportattribute.- Parameters:
port- The value for port- Returns:
thisbuilder for use in a chained invocation
-
putTags
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(Map.Entry<String, ? extends 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(Map<String, ? extends 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(Map<String, ? extends 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
Initializes the value for thestatusattribute.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
protocolMin
Initializes the value for theprotocolMinattribute.- Parameters:
protocolMin- The value for protocolMin- Returns:
thisbuilder for use in a chained invocation
-
protocolMax
Initializes the value for theprotocolMaxattribute.- Parameters:
protocolMax- The value for protocolMax- Returns:
thisbuilder for use in a chained invocation
-
protocolCur
Initializes the value for theprotocolCurattribute.- Parameters:
protocolCur- The value for protocolCur- Returns:
thisbuilder for use in a chained invocation
-
delegateMin
Initializes the value for thedelegateMinattribute.- Parameters:
delegateMin- The value for delegateMin- Returns:
thisbuilder for use in a chained invocation
-
delegateMax
Initializes the value for thedelegateMaxattribute.- Parameters:
delegateMax- The value for delegateMax- Returns:
thisbuilder for use in a chained invocation
-
delegateCur
Initializes the value for thedelegateCurattribute.- Parameters:
delegateCur- The value for delegateCur- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableMember.- Returns:
- An immutable instance of Member
- Throws:
IllegalStateException- if any required attributes are missing
-