// Generated by the protocol buffer compiler. DO NOT EDIT! // source: load_balancer.proto package io.grpc.grpclb; /** * Protobuf type {@code grpc.lb.v1.ServerList} */ public final class ServerList extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:grpc.lb.v1.ServerList) ServerListOrBuilder { // Use ServerList.newBuilder() to construct. private ServerList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ServerList() { servers_ = java.util.Collections.emptyList(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private ServerList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); int mutable_bitField0_ = 0; try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!input.skipField(tag)) { done = true; } break; } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { servers_ = new java.util.ArrayList<io.grpc.grpclb.Server>(); mutable_bitField0_ |= 0x00000001; } servers_.add( input.readMessage(io.grpc.grpclb.Server.parser(), extensionRegistry)); break; } case 26: { com.google.protobuf.Duration.Builder subBuilder = null; if (expirationInterval_ != null) { subBuilder = expirationInterval_.toBuilder(); } expirationInterval_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(expirationInterval_); expirationInterval_ = subBuilder.buildPartial(); } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { servers_ = java.util.Collections.unmodifiableList(servers_); } makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.grpclb.LoadBalancerProto.internal_static_grpc_lb_v1_ServerList_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grpc.grpclb.LoadBalancerProto.internal_static_grpc_lb_v1_ServerList_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.grpclb.ServerList.class, io.grpc.grpclb.ServerList.Builder.class); } private int bitField0_; public static final int SERVERS_FIELD_NUMBER = 1; private java.util.List<io.grpc.grpclb.Server> servers_; /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public java.util.List<io.grpc.grpclb.Server> getServersList() { return servers_; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public java.util.List<? extends io.grpc.grpclb.ServerOrBuilder> getServersOrBuilderList() { return servers_; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public int getServersCount() { return servers_.size(); } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.Server getServers(int index) { return servers_.get(index); } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.ServerOrBuilder getServersOrBuilder( int index) { return servers_.get(index); } public static final int EXPIRATION_INTERVAL_FIELD_NUMBER = 3; private com.google.protobuf.Duration expirationInterval_; /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public boolean hasExpirationInterval() { return expirationInterval_ != null; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public com.google.protobuf.Duration getExpirationInterval() { return expirationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expirationInterval_; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public com.google.protobuf.DurationOrBuilder getExpirationIntervalOrBuilder() { return getExpirationInterval(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < servers_.size(); i++) { output.writeMessage(1, servers_.get(i)); } if (expirationInterval_ != null) { output.writeMessage(3, getExpirationInterval()); } } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < servers_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, servers_.get(i)); } if (expirationInterval_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getExpirationInterval()); } memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grpc.grpclb.ServerList)) { return super.equals(obj); } io.grpc.grpclb.ServerList other = (io.grpc.grpclb.ServerList) obj; boolean result = true; result = result && getServersList() .equals(other.getServersList()); result = result && (hasExpirationInterval() == other.hasExpirationInterval()); if (hasExpirationInterval()) { result = result && getExpirationInterval() .equals(other.getExpirationInterval()); } return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getServersCount() > 0) { hash = (37 * hash) + SERVERS_FIELD_NUMBER; hash = (53 * hash) + getServersList().hashCode(); } if (hasExpirationInterval()) { hash = (37 * hash) + EXPIRATION_INTERVAL_FIELD_NUMBER; hash = (53 * hash) + getExpirationInterval().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.grpc.grpclb.ServerList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.grpclb.ServerList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.grpclb.ServerList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.grpclb.ServerList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.grpclb.ServerList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.grpc.grpclb.ServerList parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static io.grpc.grpclb.ServerList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.grpc.grpclb.ServerList parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.grpc.grpclb.ServerList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.grpc.grpclb.ServerList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.grpc.grpclb.ServerList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code grpc.lb.v1.ServerList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:grpc.lb.v1.ServerList) io.grpc.grpclb.ServerListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.grpclb.LoadBalancerProto.internal_static_grpc_lb_v1_ServerList_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grpc.grpclb.LoadBalancerProto.internal_static_grpc_lb_v1_ServerList_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.grpclb.ServerList.class, io.grpc.grpclb.ServerList.Builder.class); } // Construct using io.grpc.grpclb.ServerList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getServersFieldBuilder(); } } public Builder clear() { super.clear(); if (serversBuilder_ == null) { servers_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { serversBuilder_.clear(); } if (expirationIntervalBuilder_ == null) { expirationInterval_ = null; } else { expirationInterval_ = null; expirationIntervalBuilder_ = null; } return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.grpc.grpclb.LoadBalancerProto.internal_static_grpc_lb_v1_ServerList_descriptor; } public io.grpc.grpclb.ServerList getDefaultInstanceForType() { return io.grpc.grpclb.ServerList.getDefaultInstance(); } public io.grpc.grpclb.ServerList build() { io.grpc.grpclb.ServerList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public io.grpc.grpclb.ServerList buildPartial() { io.grpc.grpclb.ServerList result = new io.grpc.grpclb.ServerList(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (serversBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { servers_ = java.util.Collections.unmodifiableList(servers_); bitField0_ = (bitField0_ & ~0x00000001); } result.servers_ = servers_; } else { result.servers_ = serversBuilder_.build(); } if (expirationIntervalBuilder_ == null) { result.expirationInterval_ = expirationInterval_; } else { result.expirationInterval_ = expirationIntervalBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.grpc.grpclb.ServerList) { return mergeFrom((io.grpc.grpclb.ServerList)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.grpc.grpclb.ServerList other) { if (other == io.grpc.grpclb.ServerList.getDefaultInstance()) return this; if (serversBuilder_ == null) { if (!other.servers_.isEmpty()) { if (servers_.isEmpty()) { servers_ = other.servers_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureServersIsMutable(); servers_.addAll(other.servers_); } onChanged(); } } else { if (!other.servers_.isEmpty()) { if (serversBuilder_.isEmpty()) { serversBuilder_.dispose(); serversBuilder_ = null; servers_ = other.servers_; bitField0_ = (bitField0_ & ~0x00000001); serversBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getServersFieldBuilder() : null; } else { serversBuilder_.addAllMessages(other.servers_); } } } if (other.hasExpirationInterval()) { mergeExpirationInterval(other.getExpirationInterval()); } onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { io.grpc.grpclb.ServerList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.grpc.grpclb.ServerList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.util.List<io.grpc.grpclb.Server> servers_ = java.util.Collections.emptyList(); private void ensureServersIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { servers_ = new java.util.ArrayList<io.grpc.grpclb.Server>(servers_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< io.grpc.grpclb.Server, io.grpc.grpclb.Server.Builder, io.grpc.grpclb.ServerOrBuilder> serversBuilder_; /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public java.util.List<io.grpc.grpclb.Server> getServersList() { if (serversBuilder_ == null) { return java.util.Collections.unmodifiableList(servers_); } else { return serversBuilder_.getMessageList(); } } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public int getServersCount() { if (serversBuilder_ == null) { return servers_.size(); } else { return serversBuilder_.getCount(); } } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.Server getServers(int index) { if (serversBuilder_ == null) { return servers_.get(index); } else { return serversBuilder_.getMessage(index); } } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder setServers( int index, io.grpc.grpclb.Server value) { if (serversBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureServersIsMutable(); servers_.set(index, value); onChanged(); } else { serversBuilder_.setMessage(index, value); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder setServers( int index, io.grpc.grpclb.Server.Builder builderForValue) { if (serversBuilder_ == null) { ensureServersIsMutable(); servers_.set(index, builderForValue.build()); onChanged(); } else { serversBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder addServers(io.grpc.grpclb.Server value) { if (serversBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureServersIsMutable(); servers_.add(value); onChanged(); } else { serversBuilder_.addMessage(value); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder addServers( int index, io.grpc.grpclb.Server value) { if (serversBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureServersIsMutable(); servers_.add(index, value); onChanged(); } else { serversBuilder_.addMessage(index, value); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder addServers( io.grpc.grpclb.Server.Builder builderForValue) { if (serversBuilder_ == null) { ensureServersIsMutable(); servers_.add(builderForValue.build()); onChanged(); } else { serversBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder addServers( int index, io.grpc.grpclb.Server.Builder builderForValue) { if (serversBuilder_ == null) { ensureServersIsMutable(); servers_.add(index, builderForValue.build()); onChanged(); } else { serversBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder addAllServers( java.lang.Iterable<? extends io.grpc.grpclb.Server> values) { if (serversBuilder_ == null) { ensureServersIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, servers_); onChanged(); } else { serversBuilder_.addAllMessages(values); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder clearServers() { if (serversBuilder_ == null) { servers_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { serversBuilder_.clear(); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public Builder removeServers(int index) { if (serversBuilder_ == null) { ensureServersIsMutable(); servers_.remove(index); onChanged(); } else { serversBuilder_.remove(index); } return this; } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.Server.Builder getServersBuilder( int index) { return getServersFieldBuilder().getBuilder(index); } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.ServerOrBuilder getServersOrBuilder( int index) { if (serversBuilder_ == null) { return servers_.get(index); } else { return serversBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public java.util.List<? extends io.grpc.grpclb.ServerOrBuilder> getServersOrBuilderList() { if (serversBuilder_ != null) { return serversBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(servers_); } } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.Server.Builder addServersBuilder() { return getServersFieldBuilder().addBuilder( io.grpc.grpclb.Server.getDefaultInstance()); } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public io.grpc.grpclb.Server.Builder addServersBuilder( int index) { return getServersFieldBuilder().addBuilder( index, io.grpc.grpclb.Server.getDefaultInstance()); } /** * <pre> * Contains a list of servers selected by the load balancer. The list will * be updated when server resolutions change or as needed to balance load * across more servers. The client should consume the server list in order * unless instructed otherwise via the client_config. * </pre> * * <code>repeated .grpc.lb.v1.Server servers = 1;</code> */ public java.util.List<io.grpc.grpclb.Server.Builder> getServersBuilderList() { return getServersFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< io.grpc.grpclb.Server, io.grpc.grpclb.Server.Builder, io.grpc.grpclb.ServerOrBuilder> getServersFieldBuilder() { if (serversBuilder_ == null) { serversBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< io.grpc.grpclb.Server, io.grpc.grpclb.Server.Builder, io.grpc.grpclb.ServerOrBuilder>( servers_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean()); servers_ = null; } return serversBuilder_; } private com.google.protobuf.Duration expirationInterval_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> expirationIntervalBuilder_; /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public boolean hasExpirationInterval() { return expirationIntervalBuilder_ != null || expirationInterval_ != null; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public com.google.protobuf.Duration getExpirationInterval() { if (expirationIntervalBuilder_ == null) { return expirationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expirationInterval_; } else { return expirationIntervalBuilder_.getMessage(); } } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public Builder setExpirationInterval(com.google.protobuf.Duration value) { if (expirationIntervalBuilder_ == null) { if (value == null) { throw new NullPointerException(); } expirationInterval_ = value; onChanged(); } else { expirationIntervalBuilder_.setMessage(value); } return this; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public Builder setExpirationInterval( com.google.protobuf.Duration.Builder builderForValue) { if (expirationIntervalBuilder_ == null) { expirationInterval_ = builderForValue.build(); onChanged(); } else { expirationIntervalBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public Builder mergeExpirationInterval(com.google.protobuf.Duration value) { if (expirationIntervalBuilder_ == null) { if (expirationInterval_ != null) { expirationInterval_ = com.google.protobuf.Duration.newBuilder(expirationInterval_).mergeFrom(value).buildPartial(); } else { expirationInterval_ = value; } onChanged(); } else { expirationIntervalBuilder_.mergeFrom(value); } return this; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public Builder clearExpirationInterval() { if (expirationIntervalBuilder_ == null) { expirationInterval_ = null; onChanged(); } else { expirationInterval_ = null; expirationIntervalBuilder_ = null; } return this; } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public com.google.protobuf.Duration.Builder getExpirationIntervalBuilder() { onChanged(); return getExpirationIntervalFieldBuilder().getBuilder(); } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ public com.google.protobuf.DurationOrBuilder getExpirationIntervalOrBuilder() { if (expirationIntervalBuilder_ != null) { return expirationIntervalBuilder_.getMessageOrBuilder(); } else { return expirationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expirationInterval_; } } /** * <pre> * Indicates the amount of time that the client should consider this server * list as valid. It may be considered stale after waiting this interval of * time after receiving the list. If the interval is not positive, the * client can assume the list is valid until the next list is received. * </pre> * * <code>.google.protobuf.Duration expiration_interval = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> getExpirationIntervalFieldBuilder() { if (expirationIntervalBuilder_ == null) { expirationIntervalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( getExpirationInterval(), getParentForChildren(), isClean()); expirationInterval_ = null; } return expirationIntervalBuilder_; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } // @@protoc_insertion_point(builder_scope:grpc.lb.v1.ServerList) } // @@protoc_insertion_point(class_scope:grpc.lb.v1.ServerList) private static final io.grpc.grpclb.ServerList DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.grpc.grpclb.ServerList(); } public static io.grpc.grpclb.ServerList getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ServerList> PARSER = new com.google.protobuf.AbstractParser<ServerList>() { public ServerList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ServerList(input, extensionRegistry); } }; public static com.google.protobuf.Parser<ServerList> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ServerList> getParserForType() { return PARSER; } public io.grpc.grpclb.ServerList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }