From 53ace3cba8155a5c6bacc231f10b74eafcf5b919 Mon Sep 17 00:00:00 2001 From: Encho Belezirev Date: Tue, 19 Nov 2019 15:23:27 +0200 Subject: [PATCH] Introduce LoggregatorV2 Client --- cloudfoundry-client-reactor/pom.xml | 4 + .../reactor/client/v3/FilterBuilder.java | 2 +- .../reactor/doppler/MultipartCodec.java | 53 +- .../AbstractLoggregatorOperations.java | 58 + .../ReactorLoggregatorEndpoints.java | 38 + .../_ReactorLoggregatorClient.java | 54 + cloudfoundry-client/pom.xml | 4 + .../org/cloudfoundry/doppler/MessageType.java | 12 + .../doppler/_ContainerMetric.java | 25 + .../cloudfoundry/doppler/_CounterEvent.java | 10 + .../org/cloudfoundry/doppler/_Envelope.java | 28 + .../org/cloudfoundry/doppler/_LogMessage.java | 16 + .../loggregator/v2/LoggregatorClient.java | 25 + .../loggregator/v2/LoggregatorEnvelope.java | 9641 +++++++++++++++++ .../loggregator/v2/_StreamRequest.java | 58 + pom.xml | 11 + 16 files changed, 10033 insertions(+), 6 deletions(-) create mode 100644 cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/AbstractLoggregatorOperations.java create mode 100644 cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/ReactorLoggregatorEndpoints.java create mode 100644 cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/_ReactorLoggregatorClient.java create mode 100644 cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorClient.java create mode 100644 cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorEnvelope.java create mode 100644 cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/_StreamRequest.java diff --git a/cloudfoundry-client-reactor/pom.xml b/cloudfoundry-client-reactor/pom.xml index e28c5dc40c0..36504bd0b67 100644 --- a/cloudfoundry-client-reactor/pom.xml +++ b/cloudfoundry-client-reactor/pom.xml @@ -55,6 +55,10 @@ mockwebserver test + + com.google.protobuf + protobuf-java-util + io.jsonwebtoken jjwt diff --git a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/FilterBuilder.java b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/FilterBuilder.java index d3c9b8016ce..b20bd96110e 100644 --- a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/FilterBuilder.java +++ b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/FilterBuilder.java @@ -30,7 +30,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -final class FilterBuilder { +public final class FilterBuilder { private FilterBuilder() { } diff --git a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/doppler/MultipartCodec.java b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/doppler/MultipartCodec.java index f985c25a2c3..0665815bce3 100644 --- a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/doppler/MultipartCodec.java +++ b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/doppler/MultipartCodec.java @@ -16,24 +16,31 @@ package org.cloudfoundry.reactor.doppler; +import com.google.protobuf.util.JsonFormat; import io.netty.buffer.Unpooled; import io.netty.handler.codec.DelimiterBasedFrameDecoder; import io.netty.handler.codec.http.HttpHeaderNames; +import org.cloudfoundry.loggregator.v2.LoggregatorEnvelope; +import org.springframework.http.codec.ServerSentEvent; import reactor.core.publisher.Flux; import reactor.netty.ByteBufFlux; import reactor.netty.http.client.HttpClientResponse; +import java.io.IOException; import java.io.InputStream; +import java.io.StringReader; import java.nio.charset.Charset; import java.util.regex.Matcher; import java.util.regex.Pattern; -final class MultipartCodec { +public final class MultipartCodec { private static final Pattern BOUNDARY_PATTERN = Pattern.compile("multipart/.+; boundary=(.*)"); private static final int MAX_PAYLOAD_SIZE = 1024 * 1024; + private static final String SERVER_SENT_EVENT_DATA_STRING = "data: "; + private MultipartCodec() { } @@ -47,10 +54,6 @@ static DelimiterBasedFrameDecoder createDecoder(HttpClientResponse response) { Unpooled.copiedBuffer(String.format("\r\n--%s--\r\n", boundary), Charset.defaultCharset())); } - static Flux decode(ByteBufFlux body) { - return body.asInputStream() - .skip(1); - } private static String extractMultipartBoundary(HttpClientResponse response) { String contentType = response.responseHeaders().get(HttpHeaderNames.CONTENT_TYPE); @@ -63,4 +66,44 @@ private static String extractMultipartBoundary(HttpClientResponse response) { } } + public static DelimiterBasedFrameDecoder createSimpleDecoder(HttpClientResponse response) { + return new DelimiterBasedFrameDecoder(MAX_PAYLOAD_SIZE, + Unpooled.copiedBuffer("\n\n", Charset.defaultCharset())); + } + + public static Flux decode(ByteBufFlux body) { + return body.asInputStream().skip(1); + } + + public static Flux decodeAsEnvelope(ByteBufFlux body) { + return body.asString().flatMap(bodyString -> Flux.fromIterable(parseBatch(bodyString).getBatchList())); + } + + private static LoggregatorEnvelope.EnvelopeBatch parseBatch(String bodyString) { + if (bodyString.startsWith("event: ")) { + return emptyBatch(); + } + + if (bodyString.contains("heartbeat")) { + return emptyBatch(); + } + + if (bodyString.startsWith(SERVER_SENT_EVENT_DATA_STRING)) { + try { + ServerSentEvent serverSentEvent = ServerSentEvent.builder(bodyString.substring(SERVER_SENT_EVENT_DATA_STRING.length())).build(); + LoggregatorEnvelope.EnvelopeBatch.Builder builder = LoggregatorEnvelope.EnvelopeBatch.newBuilder(); + JsonFormat.parser().merge(new StringReader(serverSentEvent.data()), builder); + return builder.build(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + return emptyBatch(); + } + + private static LoggregatorEnvelope.EnvelopeBatch emptyBatch() { + return LoggregatorEnvelope.EnvelopeBatch.newBuilder().build(); + } + + } diff --git a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/AbstractLoggregatorOperations.java b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/AbstractLoggregatorOperations.java new file mode 100644 index 00000000000..c2ff00d4fdb --- /dev/null +++ b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/AbstractLoggregatorOperations.java @@ -0,0 +1,58 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cloudfoundry.reactor.loggregator; + +import io.netty.channel.ChannelHandler; +import org.cloudfoundry.reactor.ConnectionContext; +import org.cloudfoundry.reactor.TokenProvider; +import org.cloudfoundry.reactor.client.QueryBuilder; +import org.cloudfoundry.reactor.client.v3.FilterBuilder; +import org.cloudfoundry.reactor.util.AbstractReactorOperations; +import org.springframework.web.util.UriComponentsBuilder; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.netty.ByteBufFlux; +import reactor.netty.http.client.HttpClientResponse; + +import java.util.function.Function; + + +abstract class AbstractLoggregatorOperations extends AbstractReactorOperations { + + protected AbstractLoggregatorOperations(ConnectionContext connectionContext, Mono root, TokenProvider tokenProvider) { + super(connectionContext, root, tokenProvider); + } + + Flux get(Object requestPayload, Function uriTransformer, Function channelHandlerBuilder, + Function> bodyTransformer) { + return createOperator().flatMapMany(operator -> operator.get() + .uri(queryTransformer(requestPayload).andThen(uriTransformer)) + .response() + .addChannelHandler(channelHandlerBuilder) + .parseBodyToFlux(responseWithBody -> bodyTransformer.apply(responseWithBody.getBody()))); + } + + private static Function queryTransformer(Object requestPayload) { + return builder -> { + FilterBuilder.augment(builder, requestPayload); + QueryBuilder.augment(builder, requestPayload); + + return builder; + }; + } + +} diff --git a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/ReactorLoggregatorEndpoints.java b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/ReactorLoggregatorEndpoints.java new file mode 100644 index 00000000000..67c70c4981b --- /dev/null +++ b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/ReactorLoggregatorEndpoints.java @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cloudfoundry.reactor.loggregator; + +import org.cloudfoundry.doppler.Envelope; +import org.cloudfoundry.loggregator.v2.StreamRequest; +import org.cloudfoundry.reactor.ConnectionContext; +import org.cloudfoundry.reactor.TokenProvider; +import org.cloudfoundry.reactor.doppler.MultipartCodec; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class ReactorLoggregatorEndpoints extends AbstractLoggregatorOperations { + + ReactorLoggregatorEndpoints(ConnectionContext connectionContext, Mono root, TokenProvider tokenProvider) { + super(connectionContext, root, tokenProvider); + } + + public Flux stream(StreamRequest request) { + return get(request, uriComponentsBuilder -> uriComponentsBuilder.pathSegment("v2/read"), MultipartCodec::createSimpleDecoder, MultipartCodec::decodeAsEnvelope) + .map(Envelope::from) + .checkpoint(); + } +} diff --git a/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/_ReactorLoggregatorClient.java b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/_ReactorLoggregatorClient.java new file mode 100644 index 00000000000..91b6ef63e4c --- /dev/null +++ b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/loggregator/_ReactorLoggregatorClient.java @@ -0,0 +1,54 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cloudfoundry.reactor.loggregator; + +import org.cloudfoundry.doppler.Envelope; +import org.cloudfoundry.loggregator.v2.LoggregatorClient; +import org.cloudfoundry.loggregator.v2.StreamRequest; +import org.cloudfoundry.reactor.ConnectionContext; +import org.cloudfoundry.reactor.TokenProvider; +import org.immutables.value.Value; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@Value.Immutable +abstract class _ReactorLoggregatorClient implements LoggregatorClient { + @Override + public Flux stream(StreamRequest request) { + return getLoggregatorEndpoints().stream(request); + } + + @Value.Derived + ReactorLoggregatorEndpoints getLoggregatorEndpoints() { + return new ReactorLoggregatorEndpoints(getConnectionContext(), getRoot(), getTokenProvider()); + } + + @Value.Default + Mono getRoot() { + return getConnectionContext().getRootProvider().getRoot("log_stream", getConnectionContext()); + } + + /** + * The connection context + */ + abstract ConnectionContext getConnectionContext(); + + /** + * The token provider + */ + abstract TokenProvider getTokenProvider(); +} diff --git a/cloudfoundry-client/pom.xml b/cloudfoundry-client/pom.xml index 11f4c3ac5ef..fc37328b608 100644 --- a/cloudfoundry-client/pom.xml +++ b/cloudfoundry-client/pom.xml @@ -47,6 +47,10 @@ com.squareup.wire wire-runtime + + com.google.protobuf + protobuf-java + junit junit diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/MessageType.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/MessageType.java index b80b80fbd49..e660db91f43 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/MessageType.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/MessageType.java @@ -16,6 +16,8 @@ package org.cloudfoundry.doppler; +import org.cloudfoundry.loggregator.v2.LoggregatorEnvelope; + import java.util.Objects; /** @@ -43,5 +45,15 @@ static MessageType from(org.cloudfoundry.dropsonde.events.LogMessage.MessageType throw new IllegalArgumentException(String.format("Unknown message type: %s", dropsonde)); } } + static MessageType from(LoggregatorEnvelope.Log.Type type) { + switch (Objects.requireNonNull(type, "log type")) { + case ERR: + return ERR; + case OUT: + return OUT; + default: + throw new IllegalArgumentException(String.format("Unknown message type: %s", type)); + } + } } diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_ContainerMetric.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_ContainerMetric.java index 7f126b29c4b..c90d23e4496 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_ContainerMetric.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_ContainerMetric.java @@ -17,6 +17,7 @@ package org.cloudfoundry.doppler; import org.cloudfoundry.Nullable; +import org.cloudfoundry.loggregator.v2.LoggregatorEnvelope; import org.immutables.value.Value; import java.util.Objects; @@ -41,6 +42,30 @@ public static ContainerMetric from(org.cloudfoundry.dropsonde.events.ContainerMe .build(); } + public static ContainerMetric from(LoggregatorEnvelope.Envelope envelope) { + Objects.requireNonNull(envelope.getGauge(), "envelope"); + + LoggregatorEnvelope.Gauge gauge = envelope.getGauge(); + return ContainerMetric.builder() + .applicationId(envelope.getSourceId()) + .instanceIndex(Integer.parseInt(envelope.getInstanceId())) + .cpuPercentage(getMetricsValue(gauge, "cpu")) + .diskBytes(getLongValue(gauge, "disk")) + .diskBytesQuota(getLongValue(gauge, "disk_quota")) + .memoryBytes(getLongValue(gauge, "memory")) + .memoryBytesQuota(getLongValue(gauge, "memory_quota")) + .build(); + } + + private static Long getLongValue(LoggregatorEnvelope.Gauge gauge, String property) { + double metricsValue = getMetricsValue(gauge, property); + return Double.valueOf(metricsValue).longValue(); + } + + private static double getMetricsValue(LoggregatorEnvelope.Gauge gauge, String property) { + return gauge.getMetricsMap().getOrDefault(property, LoggregatorEnvelope.GaugeValue.newBuilder().setValue(0.0).build()).getValue(); + } + /** * The ID of the contained application */ diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_CounterEvent.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_CounterEvent.java index 9abed04bfb5..c40dce54704 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_CounterEvent.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_CounterEvent.java @@ -17,6 +17,7 @@ package org.cloudfoundry.doppler; import org.cloudfoundry.Nullable; +import org.cloudfoundry.loggregator.v2.LoggregatorEnvelope; import org.immutables.value.Value; import java.util.Objects; @@ -36,6 +37,15 @@ public static CounterEvent from(org.cloudfoundry.dropsonde.events.CounterEvent d .total(dropsonde.total) .build(); } + public static CounterEvent from(LoggregatorEnvelope.Counter counter) { + Objects.requireNonNull(counter, "counter"); + + return CounterEvent.builder() + .delta(counter.getDelta()) + .name(counter.getName()) + .total(counter.getTotal()) + .build(); + } /** * The amount by which to increment the counter diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_Envelope.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_Envelope.java index e925d3bf775..05a07d5928b 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_Envelope.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_Envelope.java @@ -18,6 +18,7 @@ import org.cloudfoundry.AllowNulls; import org.cloudfoundry.Nullable; +import org.cloudfoundry.loggregator.v2.LoggregatorEnvelope; import org.immutables.value.Value; import java.util.Map; @@ -53,6 +54,33 @@ public static Envelope from(org.cloudfoundry.dropsonde.events.Envelope dropsonde return envelope.build(); } + public static Envelope from(LoggregatorEnvelope.Envelope envelope) { + Objects.requireNonNull(envelope, "envelope"); + + Envelope.Builder envelopeBuilder = Envelope.builder() + .deployment(envelope.getTagsMap().get("deployment")) + .index(envelope.getTagsMap().get("index")) + .ip(envelope.getTagsMap().get("ip")) + .job(envelope.getTagsMap().get("job")) + .origin(envelope.getTagsMap().get("origin")) + .tags(envelope.getTagsMap()) + .timestamp(envelope.getTimestamp()); + + if (envelope.hasGauge()) { + envelopeBuilder.containerMetric(ContainerMetric.from(envelope)); + envelopeBuilder.eventType(EventType.CONTAINER_METRIC); + } + if (envelope.hasCounter()) { + envelopeBuilder.counterEvent(CounterEvent.from(envelope.getCounter())); + envelopeBuilder.eventType(EventType.COUNTER_EVENT); + } + if (envelope.hasLog()) { + envelopeBuilder.logMessage(LogMessage.from(envelope)); + envelopeBuilder.eventType(EventType.LOG_MESSAGE); + } + return envelopeBuilder.build(); + } + /** * The enclosed {@link ContainerMetric} */ diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_LogMessage.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_LogMessage.java index 5e94451774a..bb5b2d24279 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_LogMessage.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/doppler/_LogMessage.java @@ -17,8 +17,10 @@ package org.cloudfoundry.doppler; import org.cloudfoundry.Nullable; +import org.cloudfoundry.loggregator.v2.LoggregatorEnvelope; import org.immutables.value.Value; +import java.nio.charset.Charset; import java.util.Objects; /** @@ -40,6 +42,20 @@ public static LogMessage from(org.cloudfoundry.dropsonde.events.LogMessage drops .build(); } + public static LogMessage from(LoggregatorEnvelope.Envelope envelope) { + Objects.requireNonNull(envelope, "envelope"); + + LoggregatorEnvelope.Log log = envelope.getLog(); + return LogMessage.builder() + .applicationId(envelope.getSourceId()) + .message(log.getPayload().toString(Charset.defaultCharset())) + .messageType(MessageType.from(log.getType())) + .sourceInstance(envelope.getInstanceId()) + .sourceType(envelope.getTagsMap().get("source_type")) + .timestamp(envelope.getTimestamp()) + .build(); + } + /** * The application that emitted the message (or to which the application is related) */ diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorClient.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorClient.java new file mode 100644 index 00000000000..cce8b2072db --- /dev/null +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorClient.java @@ -0,0 +1,25 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cloudfoundry.loggregator.v2; + +import org.cloudfoundry.doppler.Envelope; +import reactor.core.publisher.Flux; + +public interface LoggregatorClient { + + Flux stream(StreamRequest request); +} diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorEnvelope.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorEnvelope.java new file mode 100644 index 00000000000..ecc4ae63a11 --- /dev/null +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/LoggregatorEnvelope.java @@ -0,0 +1,9641 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: envelope.proto + +package org.cloudfoundry.loggregator.v2; + +public final class LoggregatorEnvelope { + + private LoggregatorEnvelope() { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface EnvelopeOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Envelope) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 timestamp = 1; + * + * @return The timestamp. + */ + long getTimestamp(); + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return The sourceId. + */ + String getSourceId(); + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return The bytes for sourceId. + */ + com.google.protobuf.ByteString + getSourceIdBytes(); + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return The instanceId. + */ + String getInstanceId(); + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString + getInstanceIdBytes(); + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + int getDeprecatedTagsCount(); + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + boolean containsDeprecatedTags( + String key); + + /** + * Use {@link #getDeprecatedTagsMap()} instead. + */ + @Deprecated + java.util.Map + getDeprecatedTags(); + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + java.util.Map + getDeprecatedTagsMap(); + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + Value getDeprecatedTagsOrDefault( + String key, + Value defaultValue); + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + Value getDeprecatedTagsOrThrow( + String key); + + /** + * map<string, string> tags = 9; + */ + int getTagsCount(); + + /** + * map<string, string> tags = 9; + */ + boolean containsTags( + String key); + + /** + * Use {@link #getTagsMap()} instead. + */ + @Deprecated + java.util.Map + getTags(); + + /** + * map<string, string> tags = 9; + */ + java.util.Map + getTagsMap(); + + /** + * map<string, string> tags = 9; + */ + + String getTagsOrDefault( + String key, + String defaultValue); + + /** + * map<string, string> tags = 9; + */ + + String getTagsOrThrow( + String key); + + /** + * .loggregator.v2.Log log = 4; + * + * @return Whether the log field is set. + */ + boolean hasLog(); + + /** + * .loggregator.v2.Log log = 4; + * + * @return The log. + */ + Log getLog(); + + /** + * .loggregator.v2.Log log = 4; + */ + LogOrBuilder getLogOrBuilder(); + + /** + * .loggregator.v2.Counter counter = 5; + * + * @return Whether the counter field is set. + */ + boolean hasCounter(); + + /** + * .loggregator.v2.Counter counter = 5; + * + * @return The counter. + */ + Counter getCounter(); + + /** + * .loggregator.v2.Counter counter = 5; + */ + CounterOrBuilder getCounterOrBuilder(); + + /** + * .loggregator.v2.Gauge gauge = 6; + * + * @return Whether the gauge field is set. + */ + boolean hasGauge(); + + /** + * .loggregator.v2.Gauge gauge = 6; + * + * @return The gauge. + */ + Gauge getGauge(); + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + GaugeOrBuilder getGaugeOrBuilder(); + + /** + * .loggregator.v2.Timer timer = 7; + * + * @return Whether the timer field is set. + */ + boolean hasTimer(); + + /** + * .loggregator.v2.Timer timer = 7; + * + * @return The timer. + */ + Timer getTimer(); + + /** + * .loggregator.v2.Timer timer = 7; + */ + TimerOrBuilder getTimerOrBuilder(); + + /** + * .loggregator.v2.Event event = 10; + * + * @return Whether the event field is set. + */ + boolean hasEvent(); + + /** + * .loggregator.v2.Event event = 10; + * + * @return The event. + */ + Event getEvent(); + + /** + * .loggregator.v2.Event event = 10; + */ + EventOrBuilder getEventOrBuilder(); + + public Envelope.MessageCase getMessageCase(); + } + + /** + * Protobuf type {@code loggregator.v2.Envelope} + */ + public static final class Envelope extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Envelope) + EnvelopeOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Envelope.newBuilder() to construct. + private Envelope(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Envelope() { + sourceId_ = ""; + instanceId_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Envelope(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Envelope( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + timestamp_ = input.readInt64(); + break; + } + case 18: { + String s = input.readStringRequireUtf8(); + + sourceId_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deprecatedTags_ = com.google.protobuf.MapField.newMapField( + DeprecatedTagsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + deprecatedTags__ = input.readMessage( + DeprecatedTagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + deprecatedTags_.getMutableMap().put( + deprecatedTags__.getKey(), deprecatedTags__.getValue()); + break; + } + case 34: { + Log.Builder subBuilder = null; + if (messageCase_ == 4) { + subBuilder = ((Log) message_).toBuilder(); + } + message_ = + input.readMessage(Log.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((Log) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 4; + break; + } + case 42: { + Counter.Builder subBuilder = null; + if (messageCase_ == 5) { + subBuilder = ((Counter) message_).toBuilder(); + } + message_ = + input.readMessage(Counter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((Counter) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 5; + break; + } + case 50: { + Gauge.Builder subBuilder = null; + if (messageCase_ == 6) { + subBuilder = ((Gauge) message_).toBuilder(); + } + message_ = + input.readMessage(Gauge.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((Gauge) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 6; + break; + } + case 58: { + Timer.Builder subBuilder = null; + if (messageCase_ == 7) { + subBuilder = ((Timer) message_).toBuilder(); + } + message_ = + input.readMessage(Timer.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((Timer) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 7; + break; + } + case 66: { + String s = input.readStringRequireUtf8(); + + instanceId_ = s; + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + tags_ = com.google.protobuf.MapField.newMapField( + TagsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + tags__ = input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + tags_.getMutableMap().put( + tags__.getKey(), tags__.getValue()); + break; + } + case 82: { + Event.Builder subBuilder = null; + if (messageCase_ == 10) { + subBuilder = ((Event) message_).toBuilder(); + } + message_ = + input.readMessage(Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((Event) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 10; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetDeprecatedTags(); + case 9: + return internalGetTags(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Envelope.class, Builder.class); + } + + private int messageCase_ = 0; + + private Object message_; + + public enum MessageCase + implements com.google.protobuf.Internal.EnumLite, + InternalOneOfEnum { + LOG(4), + COUNTER(5), + GAUGE(6), + TIMER(7), + EVENT(10), + MESSAGE_NOT_SET(0); + + private final int value; + + private MessageCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 4: + return LOG; + case 5: + return COUNTER; + case 6: + return GAUGE; + case 7: + return TIMER; + case 10: + return EVENT; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + } + + ; + + public MessageCase + getMessageCase() { + return MessageCase.forNumber( + messageCase_); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 1; + + private long timestamp_; + + /** + * int64 timestamp = 1; + * + * @return The timestamp. + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int SOURCE_ID_FIELD_NUMBER = 2; + + private volatile Object sourceId_; + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return The sourceId. + */ + public String getSourceId() { + Object ref = sourceId_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + sourceId_ = s; + return s; + } + } + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return The bytes for sourceId. + */ + public com.google.protobuf.ByteString + getSourceIdBytes() { + Object ref = sourceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + sourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 8; + + private volatile Object instanceId_; + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return The instanceId. + */ + public String getInstanceId() { + Object ref = instanceId_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString + getInstanceIdBytes() { + Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPRECATED_TAGS_FIELD_NUMBER = 3; + + private static final class DeprecatedTagsDefaultEntryHolder { + + static final com.google.protobuf.MapEntry< + String, Value> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_DeprecatedTagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + String, Value> deprecatedTags_; + + private com.google.protobuf.MapField + internalGetDeprecatedTags() { + if (deprecatedTags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DeprecatedTagsDefaultEntryHolder.defaultEntry); + } + return deprecatedTags_; + } + + public int getDeprecatedTagsCount() { + return internalGetDeprecatedTags().getMap().size(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public boolean containsDeprecatedTags( + String key) { + if (key == null) { + throw new NullPointerException(); + } + return internalGetDeprecatedTags().getMap().containsKey(key); + } + + /** + * Use {@link #getDeprecatedTagsMap()} instead. + */ + @Deprecated + public java.util.Map getDeprecatedTags() { + return getDeprecatedTagsMap(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public java.util.Map getDeprecatedTagsMap() { + return internalGetDeprecatedTags().getMap(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public Value getDeprecatedTagsOrDefault( + String key, + Value defaultValue) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetDeprecatedTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public Value getDeprecatedTagsOrThrow( + String key) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetDeprecatedTags().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TAGS_FIELD_NUMBER = 9; + + private static final class TagsDefaultEntryHolder { + + static final com.google.protobuf.MapEntry< + String, String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField< + String, String> tags_; + + private com.google.protobuf.MapField + internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * map<string, string> tags = 9; + */ + + public boolean containsTags( + String key) { + if (key == null) { + throw new NullPointerException(); + } + return internalGetTags().getMap().containsKey(key); + } + + /** + * Use {@link #getTagsMap()} instead. + */ + @Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * map<string, string> tags = 9; + */ + + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * map<string, string> tags = 9; + */ + + public String getTagsOrDefault( + String key, + String defaultValue) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * map<string, string> tags = 9; + */ + + public String getTagsOrThrow( + String key) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LOG_FIELD_NUMBER = 4; + + /** + * .loggregator.v2.Log log = 4; + * + * @return Whether the log field is set. + */ + public boolean hasLog() { + return messageCase_ == 4; + } + + /** + * .loggregator.v2.Log log = 4; + * + * @return The log. + */ + public Log getLog() { + if (messageCase_ == 4) { + return (Log) message_; + } + return Log.getDefaultInstance(); + } + + /** + * .loggregator.v2.Log log = 4; + */ + public LogOrBuilder getLogOrBuilder() { + if (messageCase_ == 4) { + return (Log) message_; + } + return Log.getDefaultInstance(); + } + + public static final int COUNTER_FIELD_NUMBER = 5; + + /** + * .loggregator.v2.Counter counter = 5; + * + * @return Whether the counter field is set. + */ + public boolean hasCounter() { + return messageCase_ == 5; + } + + /** + * .loggregator.v2.Counter counter = 5; + * + * @return The counter. + */ + public Counter getCounter() { + if (messageCase_ == 5) { + return (Counter) message_; + } + return Counter.getDefaultInstance(); + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public CounterOrBuilder getCounterOrBuilder() { + if (messageCase_ == 5) { + return (Counter) message_; + } + return Counter.getDefaultInstance(); + } + + public static final int GAUGE_FIELD_NUMBER = 6; + + /** + * .loggregator.v2.Gauge gauge = 6; + * + * @return Whether the gauge field is set. + */ + public boolean hasGauge() { + return messageCase_ == 6; + } + + /** + * .loggregator.v2.Gauge gauge = 6; + * + * @return The gauge. + */ + public Gauge getGauge() { + if (messageCase_ == 6) { + return (Gauge) message_; + } + return Gauge.getDefaultInstance(); + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public GaugeOrBuilder getGaugeOrBuilder() { + if (messageCase_ == 6) { + return (Gauge) message_; + } + return Gauge.getDefaultInstance(); + } + + public static final int TIMER_FIELD_NUMBER = 7; + + /** + * .loggregator.v2.Timer timer = 7; + * + * @return Whether the timer field is set. + */ + public boolean hasTimer() { + return messageCase_ == 7; + } + + /** + * .loggregator.v2.Timer timer = 7; + * + * @return The timer. + */ + public Timer getTimer() { + if (messageCase_ == 7) { + return (Timer) message_; + } + return Timer.getDefaultInstance(); + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public TimerOrBuilder getTimerOrBuilder() { + if (messageCase_ == 7) { + return (Timer) message_; + } + return Timer.getDefaultInstance(); + } + + public static final int EVENT_FIELD_NUMBER = 10; + + /** + * .loggregator.v2.Event event = 10; + * + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return messageCase_ == 10; + } + + /** + * .loggregator.v2.Event event = 10; + * + * @return The event. + */ + public Event getEvent() { + if (messageCase_ == 10) { + return (Event) message_; + } + return Event.getDefaultInstance(); + } + + /** + * .loggregator.v2.Event event = 10; + */ + public EventOrBuilder getEventOrBuilder() { + if (messageCase_ == 10) { + return (Event) message_; + } + return Event.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (timestamp_ != 0L) { + output.writeInt64(1, timestamp_); + } + if (!getSourceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceId_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetDeprecatedTags(), + DeprecatedTagsDefaultEntryHolder.defaultEntry, + 3); + if (messageCase_ == 4) { + output.writeMessage(4, (Log) message_); + } + if (messageCase_ == 5) { + output.writeMessage(5, (Counter) message_); + } + if (messageCase_ == 6) { + output.writeMessage(6, (Gauge) message_); + } + if (messageCase_ == 7) { + output.writeMessage(7, (Timer) message_); + } + if (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, instanceId_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetTags(), + TagsDefaultEntryHolder.defaultEntry, + 9); + if (messageCase_ == 10) { + output.writeMessage(10, (Event) message_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, timestamp_); + } + if (!getSourceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceId_); + } + for (java.util.Map.Entry entry + : internalGetDeprecatedTags().getMap().entrySet()) { + com.google.protobuf.MapEntry + deprecatedTags__ = DeprecatedTagsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, deprecatedTags__); + } + if (messageCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (Log) message_); + } + if (messageCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (Counter) message_); + } + if (messageCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (Gauge) message_); + } + if (messageCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (Timer) message_); + } + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, instanceId_); + } + for (java.util.Map.Entry entry + : internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry + tags__ = TagsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, tags__); + } + if (messageCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (Event) message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Envelope)) { + return super.equals(obj); + } + Envelope other = (Envelope) obj; + + if (getTimestamp() + != other.getTimestamp()) { + return false; + } + if (!getSourceId() + .equals(other.getSourceId())) { + return false; + } + if (!getInstanceId() + .equals(other.getInstanceId())) { + return false; + } + if (!internalGetDeprecatedTags().equals( + other.internalGetDeprecatedTags())) { + return false; + } + if (!internalGetTags().equals( + other.internalGetTags())) { + return false; + } + if (!getMessageCase().equals(other.getMessageCase())) { + return false; + } + switch (messageCase_) { + case 4: + if (!getLog() + .equals(other.getLog())) { + return false; + } + break; + case 5: + if (!getCounter() + .equals(other.getCounter())) { + return false; + } + break; + case 6: + if (!getGauge() + .equals(other.getGauge())) { + return false; + } + break; + case 7: + if (!getTimer() + .equals(other.getTimer())) { + return false; + } + break; + case 10: + if (!getEvent() + .equals(other.getEvent())) { + return false; + } + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (37 * hash) + SOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSourceId().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (!internalGetDeprecatedTags().getMap().isEmpty()) { + hash = (37 * hash) + DEPRECATED_TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDeprecatedTags().hashCode(); + } + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } + switch (messageCase_) { + case 4: + hash = (37 * hash) + LOG_FIELD_NUMBER; + hash = (53 * hash) + getLog().hashCode(); + break; + case 5: + hash = (37 * hash) + COUNTER_FIELD_NUMBER; + hash = (53 * hash) + getCounter().hashCode(); + break; + case 6: + hash = (37 * hash) + GAUGE_FIELD_NUMBER; + hash = (53 * hash) + getGauge().hashCode(); + break; + case 7: + hash = (37 * hash) + TIMER_FIELD_NUMBER; + hash = (53 * hash) + getTimer().hashCode(); + break; + case 10: + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Envelope parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Envelope parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Envelope parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Envelope parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Envelope parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Envelope parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Envelope parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Envelope 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 Envelope parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Envelope 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 Envelope parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Envelope parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Envelope prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Envelope} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Envelope) + EnvelopeOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetDeprecatedTags(); + case 9: + return internalGetTags(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableDeprecatedTags(); + case 9: + return internalGetMutableTags(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Envelope.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Envelope.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + timestamp_ = 0L; + + sourceId_ = ""; + + instanceId_ = ""; + + internalGetMutableDeprecatedTags().clear(); + internalGetMutableTags().clear(); + messageCase_ = 0; + message_ = null; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Envelope_descriptor; + } + + @Override + public Envelope getDefaultInstanceForType() { + return Envelope.getDefaultInstance(); + } + + @Override + public Envelope build() { + Envelope result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Envelope buildPartial() { + Envelope result = new Envelope(this); + int from_bitField0_ = bitField0_; + result.timestamp_ = timestamp_; + result.sourceId_ = sourceId_; + result.instanceId_ = instanceId_; + result.deprecatedTags_ = internalGetDeprecatedTags(); + result.deprecatedTags_.makeImmutable(); + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + if (messageCase_ == 4) { + if (logBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = logBuilder_.build(); + } + } + if (messageCase_ == 5) { + if (counterBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = counterBuilder_.build(); + } + } + if (messageCase_ == 6) { + if (gaugeBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = gaugeBuilder_.build(); + } + } + if (messageCase_ == 7) { + if (timerBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = timerBuilder_.build(); + } + } + if (messageCase_ == 10) { + if (eventBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = eventBuilder_.build(); + } + } + result.messageCase_ = messageCase_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Envelope) { + return mergeFrom((Envelope) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Envelope other) { + if (other == Envelope.getDefaultInstance()) { + return this; + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + if (!other.getSourceId().isEmpty()) { + sourceId_ = other.sourceId_; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + internalGetMutableDeprecatedTags().mergeFrom( + other.internalGetDeprecatedTags()); + internalGetMutableTags().mergeFrom( + other.internalGetTags()); + switch (other.getMessageCase()) { + case LOG: { + mergeLog(other.getLog()); + break; + } + case COUNTER: { + mergeCounter(other.getCounter()); + break; + } + case GAUGE: { + mergeGauge(other.getGauge()); + break; + } + case TIMER: { + mergeTimer(other.getTimer()); + break; + } + case EVENT: { + mergeEvent(other.getEvent()); + break; + } + case MESSAGE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Envelope parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Envelope) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int messageCase_ = 0; + + private Object message_; + + public MessageCase + getMessageCase() { + return MessageCase.forNumber( + messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private long timestamp_; + + /** + * int64 timestamp = 1; + * + * @return The timestamp. + */ + public long getTimestamp() { + return timestamp_; + } + + /** + * int64 timestamp = 1; + * + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + + /** + * int64 timestamp = 1; + * + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private Object sourceId_ = ""; + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return The sourceId. + */ + public String getSourceId() { + Object ref = sourceId_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + sourceId_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return The bytes for sourceId. + */ + public com.google.protobuf.ByteString + getSourceIdBytes() { + Object ref = sourceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + sourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @param value The sourceId to set. + * @return This builder for chaining. + */ + public Builder setSourceId( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceId_ = value; + onChanged(); + return this; + } + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @return This builder for chaining. + */ + public Builder clearSourceId() { + + sourceId_ = getDefaultInstance().getSourceId(); + onChanged(); + return this; + } + + /** + * string source_id = 2[json_name = "source_id"]; + * + * @param value The bytes for sourceId to set. + * @return This builder for chaining. + */ + public Builder setSourceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceId_ = value; + onChanged(); + return this; + } + + private Object instanceId_ = ""; + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return The instanceId. + */ + public String getInstanceId() { + Object ref = instanceId_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString + getInstanceIdBytes() { + Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + + /** + * string instance_id = 8[json_name = "instance_id"]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + String, Value> deprecatedTags_; + + private com.google.protobuf.MapField + internalGetDeprecatedTags() { + if (deprecatedTags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DeprecatedTagsDefaultEntryHolder.defaultEntry); + } + return deprecatedTags_; + } + + private com.google.protobuf.MapField + internalGetMutableDeprecatedTags() { + onChanged(); + ; + if (deprecatedTags_ == null) { + deprecatedTags_ = com.google.protobuf.MapField.newMapField( + DeprecatedTagsDefaultEntryHolder.defaultEntry); + } + if (!deprecatedTags_.isMutable()) { + deprecatedTags_ = deprecatedTags_.copy(); + } + return deprecatedTags_; + } + + public int getDeprecatedTagsCount() { + return internalGetDeprecatedTags().getMap().size(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public boolean containsDeprecatedTags( + String key) { + if (key == null) { + throw new NullPointerException(); + } + return internalGetDeprecatedTags().getMap().containsKey(key); + } + + /** + * Use {@link #getDeprecatedTagsMap()} instead. + */ + @Deprecated + public java.util.Map getDeprecatedTags() { + return getDeprecatedTagsMap(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public java.util.Map getDeprecatedTagsMap() { + return internalGetDeprecatedTags().getMap(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public Value getDeprecatedTagsOrDefault( + String key, + Value defaultValue) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetDeprecatedTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public Value getDeprecatedTagsOrThrow( + String key) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetDeprecatedTags().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDeprecatedTags() { + internalGetMutableDeprecatedTags().getMutableMap() + .clear(); + return this; + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public Builder removeDeprecatedTags( + String key) { + if (key == null) { + throw new NullPointerException(); + } + internalGetMutableDeprecatedTags().getMutableMap() + .remove(key); + return this; + } + + /** + * Use alternate mutation accessors instead. + */ + @Deprecated + public java.util.Map + getMutableDeprecatedTags() { + return internalGetMutableDeprecatedTags().getMutableMap(); + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + public Builder putDeprecatedTags( + String key, + Value value) { + if (key == null) { + throw new NullPointerException(); + } + if (value == null) { + throw new NullPointerException(); + } + internalGetMutableDeprecatedTags().getMutableMap() + .put(key, value); + return this; + } + + /** + * map<string, .loggregator.v2.Value> deprecated_tags = 3[json_name = "deprecated_tags"]; + */ + + public Builder putAllDeprecatedTags( + java.util.Map values) { + internalGetMutableDeprecatedTags().getMutableMap() + .putAll(values); + return this; + } + + private com.google.protobuf.MapField< + String, String> tags_; + + private com.google.protobuf.MapField + internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + private com.google.protobuf.MapField + internalGetMutableTags() { + onChanged(); + ; + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField( + TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * map<string, string> tags = 9; + */ + + public boolean containsTags( + String key) { + if (key == null) { + throw new NullPointerException(); + } + return internalGetTags().getMap().containsKey(key); + } + + /** + * Use {@link #getTagsMap()} instead. + */ + @Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * map<string, string> tags = 9; + */ + + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * map<string, string> tags = 9; + */ + + public String getTagsOrDefault( + String key, + String defaultValue) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * map<string, string> tags = 9; + */ + + public String getTagsOrThrow( + String key) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + internalGetMutableTags().getMutableMap() + .clear(); + return this; + } + + /** + * map<string, string> tags = 9; + */ + + public Builder removeTags( + String key) { + if (key == null) { + throw new NullPointerException(); + } + internalGetMutableTags().getMutableMap() + .remove(key); + return this; + } + + /** + * Use alternate mutation accessors instead. + */ + @Deprecated + public java.util.Map + getMutableTags() { + return internalGetMutableTags().getMutableMap(); + } + + /** + * map<string, string> tags = 9; + */ + public Builder putTags( + String key, + String value) { + if (key == null) { + throw new NullPointerException(); + } + if (value == null) { + throw new NullPointerException(); + } + internalGetMutableTags().getMutableMap() + .put(key, value); + return this; + } + + /** + * map<string, string> tags = 9; + */ + + public Builder putAllTags( + java.util.Map values) { + internalGetMutableTags().getMutableMap() + .putAll(values); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + Log, Log.Builder, LogOrBuilder> logBuilder_; + + /** + * .loggregator.v2.Log log = 4; + * + * @return Whether the log field is set. + */ + public boolean hasLog() { + return messageCase_ == 4; + } + + /** + * .loggregator.v2.Log log = 4; + * + * @return The log. + */ + public Log getLog() { + if (logBuilder_ == null) { + if (messageCase_ == 4) { + return (Log) message_; + } + return Log.getDefaultInstance(); + } else { + if (messageCase_ == 4) { + return logBuilder_.getMessage(); + } + return Log.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Log log = 4; + */ + public Builder setLog(Log value) { + if (logBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + logBuilder_.setMessage(value); + } + messageCase_ = 4; + return this; + } + + /** + * .loggregator.v2.Log log = 4; + */ + public Builder setLog( + Log.Builder builderForValue) { + if (logBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + logBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 4; + return this; + } + + /** + * .loggregator.v2.Log log = 4; + */ + public Builder mergeLog(Log value) { + if (logBuilder_ == null) { + if (messageCase_ == 4 && + message_ != Log.getDefaultInstance()) { + message_ = Log.newBuilder((Log) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 4) { + logBuilder_.mergeFrom(value); + } + logBuilder_.setMessage(value); + } + messageCase_ = 4; + return this; + } + + /** + * .loggregator.v2.Log log = 4; + */ + public Builder clearLog() { + if (logBuilder_ == null) { + if (messageCase_ == 4) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 4) { + messageCase_ = 0; + message_ = null; + } + logBuilder_.clear(); + } + return this; + } + + /** + * .loggregator.v2.Log log = 4; + */ + public Log.Builder getLogBuilder() { + return getLogFieldBuilder().getBuilder(); + } + + /** + * .loggregator.v2.Log log = 4; + */ + public LogOrBuilder getLogOrBuilder() { + if ((messageCase_ == 4) && (logBuilder_ != null)) { + return logBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 4) { + return (Log) message_; + } + return Log.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Log log = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + Log, Log.Builder, LogOrBuilder> + getLogFieldBuilder() { + if (logBuilder_ == null) { + if (!(messageCase_ == 4)) { + message_ = Log.getDefaultInstance(); + } + logBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + Log, Log.Builder, LogOrBuilder>( + (Log) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 4; + onChanged(); + ; + return logBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + Counter, Counter.Builder, CounterOrBuilder> counterBuilder_; + + /** + * .loggregator.v2.Counter counter = 5; + * + * @return Whether the counter field is set. + */ + public boolean hasCounter() { + return messageCase_ == 5; + } + + /** + * .loggregator.v2.Counter counter = 5; + * + * @return The counter. + */ + public Counter getCounter() { + if (counterBuilder_ == null) { + if (messageCase_ == 5) { + return (Counter) message_; + } + return Counter.getDefaultInstance(); + } else { + if (messageCase_ == 5) { + return counterBuilder_.getMessage(); + } + return Counter.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public Builder setCounter(Counter value) { + if (counterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + counterBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public Builder setCounter( + Counter.Builder builderForValue) { + if (counterBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + counterBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 5; + return this; + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public Builder mergeCounter(Counter value) { + if (counterBuilder_ == null) { + if (messageCase_ == 5 && + message_ != Counter.getDefaultInstance()) { + message_ = Counter.newBuilder((Counter) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 5) { + counterBuilder_.mergeFrom(value); + } + counterBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public Builder clearCounter() { + if (counterBuilder_ == null) { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + } + counterBuilder_.clear(); + } + return this; + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public Counter.Builder getCounterBuilder() { + return getCounterFieldBuilder().getBuilder(); + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + public CounterOrBuilder getCounterOrBuilder() { + if ((messageCase_ == 5) && (counterBuilder_ != null)) { + return counterBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 5) { + return (Counter) message_; + } + return Counter.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Counter counter = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + Counter, Counter.Builder, CounterOrBuilder> + getCounterFieldBuilder() { + if (counterBuilder_ == null) { + if (!(messageCase_ == 5)) { + message_ = Counter.getDefaultInstance(); + } + counterBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + Counter, Counter.Builder, CounterOrBuilder>( + (Counter) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 5; + onChanged(); + ; + return counterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + Gauge, Gauge.Builder, GaugeOrBuilder> gaugeBuilder_; + + /** + * .loggregator.v2.Gauge gauge = 6; + * + * @return Whether the gauge field is set. + */ + public boolean hasGauge() { + return messageCase_ == 6; + } + + /** + * .loggregator.v2.Gauge gauge = 6; + * + * @return The gauge. + */ + public Gauge getGauge() { + if (gaugeBuilder_ == null) { + if (messageCase_ == 6) { + return (Gauge) message_; + } + return Gauge.getDefaultInstance(); + } else { + if (messageCase_ == 6) { + return gaugeBuilder_.getMessage(); + } + return Gauge.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public Builder setGauge(Gauge value) { + if (gaugeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + gaugeBuilder_.setMessage(value); + } + messageCase_ = 6; + return this; + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public Builder setGauge( + Gauge.Builder builderForValue) { + if (gaugeBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + gaugeBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 6; + return this; + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public Builder mergeGauge(Gauge value) { + if (gaugeBuilder_ == null) { + if (messageCase_ == 6 && + message_ != Gauge.getDefaultInstance()) { + message_ = Gauge.newBuilder((Gauge) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 6) { + gaugeBuilder_.mergeFrom(value); + } + gaugeBuilder_.setMessage(value); + } + messageCase_ = 6; + return this; + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public Builder clearGauge() { + if (gaugeBuilder_ == null) { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + } + gaugeBuilder_.clear(); + } + return this; + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public Gauge.Builder getGaugeBuilder() { + return getGaugeFieldBuilder().getBuilder(); + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + public GaugeOrBuilder getGaugeOrBuilder() { + if ((messageCase_ == 6) && (gaugeBuilder_ != null)) { + return gaugeBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 6) { + return (Gauge) message_; + } + return Gauge.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Gauge gauge = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + Gauge, Gauge.Builder, GaugeOrBuilder> + getGaugeFieldBuilder() { + if (gaugeBuilder_ == null) { + if (!(messageCase_ == 6)) { + message_ = Gauge.getDefaultInstance(); + } + gaugeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + Gauge, Gauge.Builder, GaugeOrBuilder>( + (Gauge) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 6; + onChanged(); + ; + return gaugeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + Timer, Timer.Builder, TimerOrBuilder> timerBuilder_; + + /** + * .loggregator.v2.Timer timer = 7; + * + * @return Whether the timer field is set. + */ + public boolean hasTimer() { + return messageCase_ == 7; + } + + /** + * .loggregator.v2.Timer timer = 7; + * + * @return The timer. + */ + public Timer getTimer() { + if (timerBuilder_ == null) { + if (messageCase_ == 7) { + return (Timer) message_; + } + return Timer.getDefaultInstance(); + } else { + if (messageCase_ == 7) { + return timerBuilder_.getMessage(); + } + return Timer.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public Builder setTimer(Timer value) { + if (timerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + timerBuilder_.setMessage(value); + } + messageCase_ = 7; + return this; + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public Builder setTimer( + Timer.Builder builderForValue) { + if (timerBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + timerBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 7; + return this; + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public Builder mergeTimer(Timer value) { + if (timerBuilder_ == null) { + if (messageCase_ == 7 && + message_ != Timer.getDefaultInstance()) { + message_ = Timer.newBuilder((Timer) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 7) { + timerBuilder_.mergeFrom(value); + } + timerBuilder_.setMessage(value); + } + messageCase_ = 7; + return this; + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public Builder clearTimer() { + if (timerBuilder_ == null) { + if (messageCase_ == 7) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 7) { + messageCase_ = 0; + message_ = null; + } + timerBuilder_.clear(); + } + return this; + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public Timer.Builder getTimerBuilder() { + return getTimerFieldBuilder().getBuilder(); + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + public TimerOrBuilder getTimerOrBuilder() { + if ((messageCase_ == 7) && (timerBuilder_ != null)) { + return timerBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 7) { + return (Timer) message_; + } + return Timer.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Timer timer = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + Timer, Timer.Builder, TimerOrBuilder> + getTimerFieldBuilder() { + if (timerBuilder_ == null) { + if (!(messageCase_ == 7)) { + message_ = Timer.getDefaultInstance(); + } + timerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + Timer, Timer.Builder, TimerOrBuilder>( + (Timer) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 7; + onChanged(); + ; + return timerBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + Event, Event.Builder, EventOrBuilder> eventBuilder_; + + /** + * .loggregator.v2.Event event = 10; + * + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return messageCase_ == 10; + } + + /** + * .loggregator.v2.Event event = 10; + * + * @return The event. + */ + public Event getEvent() { + if (eventBuilder_ == null) { + if (messageCase_ == 10) { + return (Event) message_; + } + return Event.getDefaultInstance(); + } else { + if (messageCase_ == 10) { + return eventBuilder_.getMessage(); + } + return Event.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Event event = 10; + */ + public Builder setEvent(Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + messageCase_ = 10; + return this; + } + + /** + * .loggregator.v2.Event event = 10; + */ + public Builder setEvent( + Event.Builder builderForValue) { + if (eventBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 10; + return this; + } + + /** + * .loggregator.v2.Event event = 10; + */ + public Builder mergeEvent(Event value) { + if (eventBuilder_ == null) { + if (messageCase_ == 10 && + message_ != Event.getDefaultInstance()) { + message_ = Event.newBuilder((Event) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 10) { + eventBuilder_.mergeFrom(value); + } + eventBuilder_.setMessage(value); + } + messageCase_ = 10; + return this; + } + + /** + * .loggregator.v2.Event event = 10; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + if (messageCase_ == 10) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 10) { + messageCase_ = 0; + message_ = null; + } + eventBuilder_.clear(); + } + return this; + } + + /** + * .loggregator.v2.Event event = 10; + */ + public Event.Builder getEventBuilder() { + return getEventFieldBuilder().getBuilder(); + } + + /** + * .loggregator.v2.Event event = 10; + */ + public EventOrBuilder getEventOrBuilder() { + if ((messageCase_ == 10) && (eventBuilder_ != null)) { + return eventBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 10) { + return (Event) message_; + } + return Event.getDefaultInstance(); + } + } + + /** + * .loggregator.v2.Event event = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + Event, Event.Builder, EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + if (!(messageCase_ == 10)) { + message_ = Event.getDefaultInstance(); + } + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + Event, Event.Builder, EventOrBuilder>( + (Event) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 10; + onChanged(); + ; + return eventBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Envelope) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Envelope) + private static final Envelope DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Envelope(); + } + + public static Envelope getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Envelope parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Envelope(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Envelope getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface EnvelopeBatchOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.EnvelopeBatch) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + java.util.List + getBatchList(); + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + Envelope getBatch(int index); + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + int getBatchCount(); + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + java.util.List + getBatchOrBuilderList(); + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + EnvelopeOrBuilder getBatchOrBuilder( + int index); + } + + /** + * Protobuf type {@code loggregator.v2.EnvelopeBatch} + */ + public static final class EnvelopeBatch extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.EnvelopeBatch) + EnvelopeBatchOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use EnvelopeBatch.newBuilder() to construct. + private EnvelopeBatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnvelopeBatch() { + batch_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new EnvelopeBatch(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private EnvelopeBatch( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + batch_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + batch_.add( + input.readMessage(Envelope.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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) != 0)) { + batch_ = java.util.Collections.unmodifiableList(batch_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_EnvelopeBatch_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_EnvelopeBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + EnvelopeBatch.class, Builder.class); + } + + public static final int BATCH_FIELD_NUMBER = 1; + + private java.util.List batch_; + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public java.util.List getBatchList() { + return batch_; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public java.util.List + getBatchOrBuilderList() { + return batch_; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public int getBatchCount() { + return batch_.size(); + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Envelope getBatch(int index) { + return batch_.get(index); + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public EnvelopeOrBuilder getBatchOrBuilder( + int index) { + return batch_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < batch_.size(); i++) { + output.writeMessage(1, batch_.get(i)); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < batch_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, batch_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof EnvelopeBatch)) { + return super.equals(obj); + } + EnvelopeBatch other = (EnvelopeBatch) obj; + + if (!getBatchList() + .equals(other.getBatchList())) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBatchCount() > 0) { + hash = (37 * hash) + BATCH_FIELD_NUMBER; + hash = (53 * hash) + getBatchList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static EnvelopeBatch parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static EnvelopeBatch parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static EnvelopeBatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static EnvelopeBatch parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static EnvelopeBatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static EnvelopeBatch parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static EnvelopeBatch parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static EnvelopeBatch 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 EnvelopeBatch parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static EnvelopeBatch 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 EnvelopeBatch parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static EnvelopeBatch parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(EnvelopeBatch prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.EnvelopeBatch} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.EnvelopeBatch) + EnvelopeBatchOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_EnvelopeBatch_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_EnvelopeBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + EnvelopeBatch.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.EnvelopeBatch.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getBatchFieldBuilder(); + } + } + + @Override + public Builder clear() { + super.clear(); + if (batchBuilder_ == null) { + batch_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + batchBuilder_.clear(); + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_EnvelopeBatch_descriptor; + } + + @Override + public EnvelopeBatch getDefaultInstanceForType() { + return EnvelopeBatch.getDefaultInstance(); + } + + @Override + public EnvelopeBatch build() { + EnvelopeBatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public EnvelopeBatch buildPartial() { + EnvelopeBatch result = new EnvelopeBatch(this); + int from_bitField0_ = bitField0_; + if (batchBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + batch_ = java.util.Collections.unmodifiableList(batch_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.batch_ = batch_; + } else { + result.batch_ = batchBuilder_.build(); + } + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof EnvelopeBatch) { + return mergeFrom((EnvelopeBatch) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(EnvelopeBatch other) { + if (other == EnvelopeBatch.getDefaultInstance()) { + return this; + } + if (batchBuilder_ == null) { + if (!other.batch_.isEmpty()) { + if (batch_.isEmpty()) { + batch_ = other.batch_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBatchIsMutable(); + batch_.addAll(other.batch_); + } + onChanged(); + } + } else { + if (!other.batch_.isEmpty()) { + if (batchBuilder_.isEmpty()) { + batchBuilder_.dispose(); + batchBuilder_ = null; + batch_ = other.batch_; + bitField0_ = (bitField0_ & ~0x00000001); + batchBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBatchFieldBuilder() : null; + } else { + batchBuilder_.addAllMessages(other.batch_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + EnvelopeBatch parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (EnvelopeBatch) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List batch_ = + java.util.Collections.emptyList(); + + private void ensureBatchIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + batch_ = new java.util.ArrayList(batch_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Envelope, Envelope.Builder, EnvelopeOrBuilder> batchBuilder_; + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public java.util.List getBatchList() { + if (batchBuilder_ == null) { + return java.util.Collections.unmodifiableList(batch_); + } else { + return batchBuilder_.getMessageList(); + } + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public int getBatchCount() { + if (batchBuilder_ == null) { + return batch_.size(); + } else { + return batchBuilder_.getCount(); + } + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Envelope getBatch(int index) { + if (batchBuilder_ == null) { + return batch_.get(index); + } else { + return batchBuilder_.getMessage(index); + } + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder setBatch( + int index, Envelope value) { + if (batchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBatchIsMutable(); + batch_.set(index, value); + onChanged(); + } else { + batchBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder setBatch( + int index, Envelope.Builder builderForValue) { + if (batchBuilder_ == null) { + ensureBatchIsMutable(); + batch_.set(index, builderForValue.build()); + onChanged(); + } else { + batchBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder addBatch(Envelope value) { + if (batchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBatchIsMutable(); + batch_.add(value); + onChanged(); + } else { + batchBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder addBatch( + int index, Envelope value) { + if (batchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBatchIsMutable(); + batch_.add(index, value); + onChanged(); + } else { + batchBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder addBatch( + Envelope.Builder builderForValue) { + if (batchBuilder_ == null) { + ensureBatchIsMutable(); + batch_.add(builderForValue.build()); + onChanged(); + } else { + batchBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder addBatch( + int index, Envelope.Builder builderForValue) { + if (batchBuilder_ == null) { + ensureBatchIsMutable(); + batch_.add(index, builderForValue.build()); + onChanged(); + } else { + batchBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder addAllBatch( + Iterable values) { + if (batchBuilder_ == null) { + ensureBatchIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, batch_); + onChanged(); + } else { + batchBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder clearBatch() { + if (batchBuilder_ == null) { + batch_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + batchBuilder_.clear(); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Builder removeBatch(int index) { + if (batchBuilder_ == null) { + ensureBatchIsMutable(); + batch_.remove(index); + onChanged(); + } else { + batchBuilder_.remove(index); + } + return this; + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Envelope.Builder getBatchBuilder( + int index) { + return getBatchFieldBuilder().getBuilder(index); + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public EnvelopeOrBuilder getBatchOrBuilder( + int index) { + if (batchBuilder_ == null) { + return batch_.get(index); + } else { + return batchBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public java.util.List + getBatchOrBuilderList() { + if (batchBuilder_ != null) { + return batchBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(batch_); + } + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Envelope.Builder addBatchBuilder() { + return getBatchFieldBuilder().addBuilder( + Envelope.getDefaultInstance()); + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public Envelope.Builder addBatchBuilder( + int index) { + return getBatchFieldBuilder().addBuilder( + index, Envelope.getDefaultInstance()); + } + + /** + * repeated .loggregator.v2.Envelope batch = 1; + */ + public java.util.List + getBatchBuilderList() { + return getBatchFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Envelope, Envelope.Builder, EnvelopeOrBuilder> + getBatchFieldBuilder() { + if (batchBuilder_ == null) { + batchBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + Envelope, Envelope.Builder, EnvelopeOrBuilder>( + batch_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + batch_ = null; + } + return batchBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.EnvelopeBatch) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.EnvelopeBatch) + private static final EnvelopeBatch DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new EnvelopeBatch(); + } + + public static EnvelopeBatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public EnvelopeBatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnvelopeBatch(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public EnvelopeBatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Value) + com.google.protobuf.MessageOrBuilder { + + /** + * string text = 1; + * + * @return The text. + */ + String getText(); + + /** + * string text = 1; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + * int64 integer = 2; + * + * @return The integer. + */ + long getInteger(); + + /** + * double decimal = 3; + * + * @return The decimal. + */ + double getDecimal(); + + public Value.DataCase getDataCase(); + } + + /** + * Protobuf type {@code loggregator.v2.Value} + */ + public static final class Value extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Value) + ValueOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Value() { + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Value(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Value( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + dataCase_ = 1; + data_ = s; + break; + } + case 16: { + dataCase_ = 2; + data_ = input.readInt64(); + break; + } + case 25: { + dataCase_ = 3; + data_ = input.readDouble(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Value_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Value.class, Builder.class); + } + + private int dataCase_ = 0; + + private Object data_; + + public enum DataCase + implements com.google.protobuf.Internal.EnumLite, + InternalOneOfEnum { + TEXT(1), + INTEGER(2), + DECIMAL(3), + DATA_NOT_SET(0); + + private final int value; + + private DataCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 2: + return INTEGER; + case 3: + return DECIMAL; + case 0: + return DATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + } + + ; + + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + + /** + * string text = 1; + * + * @return The text. + */ + public String getText() { + Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (dataCase_ == 1) { + data_ = s; + } + return s; + } + } + + /** + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString + getTextBytes() { + Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + if (dataCase_ == 1) { + data_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTEGER_FIELD_NUMBER = 2; + + /** + * int64 integer = 2; + * + * @return The integer. + */ + public long getInteger() { + if (dataCase_ == 2) { + return (Long) data_; + } + return 0L; + } + + public static final int DECIMAL_FIELD_NUMBER = 3; + + /** + * double decimal = 3; + * + * @return The decimal. + */ + public double getDecimal() { + if (dataCase_ == 3) { + return (Double) data_; + } + return 0D; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dataCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, data_); + } + if (dataCase_ == 2) { + output.writeInt64( + 2, (long) ((Long) data_)); + } + if (dataCase_ == 3) { + output.writeDouble( + 3, (double) ((Double) data_)); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (dataCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, data_); + } + if (dataCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 2, (long) ((Long) data_)); + } + if (dataCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize( + 3, (double) ((Double) data_)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Value)) { + return super.equals(obj); + } + Value other = (Value) obj; + + if (!getDataCase().equals(other.getDataCase())) { + return false; + } + switch (dataCase_) { + case 1: + if (!getText() + .equals(other.getText())) { + return false; + } + break; + case 2: + if (getInteger() + != other.getInteger()) { + return false; + } + break; + case 3: + if (Double.doubleToLongBits(getDecimal()) + != Double.doubleToLongBits( + other.getDecimal())) { + return false; + } + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (dataCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + INTEGER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInteger()); + break; + case 3: + hash = (37 * hash) + DECIMAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getDecimal())); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Value parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Value parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Value parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Value parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Value parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Value 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 Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Value 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 Value parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Value parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Value prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Value} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Value) + ValueOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Value_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Value.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Value.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + dataCase_ = 0; + data_ = null; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Value_descriptor; + } + + @Override + public Value getDefaultInstanceForType() { + return Value.getDefaultInstance(); + } + + @Override + public Value build() { + Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Value buildPartial() { + Value result = new Value(this); + if (dataCase_ == 1) { + result.data_ = data_; + } + if (dataCase_ == 2) { + result.data_ = data_; + } + if (dataCase_ == 3) { + result.data_ = data_; + } + result.dataCase_ = dataCase_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Value) { + return mergeFrom((Value) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Value other) { + if (other == Value.getDefaultInstance()) { + return this; + } + switch (other.getDataCase()) { + case TEXT: { + dataCase_ = 1; + data_ = other.data_; + onChanged(); + break; + } + case INTEGER: { + setInteger(other.getInteger()); + break; + } + case DECIMAL: { + setDecimal(other.getDecimal()); + break; + } + case DATA_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Value parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Value) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dataCase_ = 0; + + private Object data_; + + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + + /** + * string text = 1; + * + * @return The text. + */ + public String getText() { + Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (dataCase_ == 1) { + data_ = s; + } + return s; + } else { + return (String) ref; + } + } + + /** + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString + getTextBytes() { + Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + if (dataCase_ == 1) { + data_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText( + String value) { + if (value == null) { + throw new NullPointerException(); + } + dataCase_ = 1; + data_ = value; + onChanged(); + return this; + } + + /** + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (dataCase_ == 1) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + /** + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataCase_ = 1; + data_ = value; + onChanged(); + return this; + } + + /** + * int64 integer = 2; + * + * @return The integer. + */ + public long getInteger() { + if (dataCase_ == 2) { + return (Long) data_; + } + return 0L; + } + + /** + * int64 integer = 2; + * + * @param value The integer to set. + * @return This builder for chaining. + */ + public Builder setInteger(long value) { + dataCase_ = 2; + data_ = value; + onChanged(); + return this; + } + + /** + * int64 integer = 2; + * + * @return This builder for chaining. + */ + public Builder clearInteger() { + if (dataCase_ == 2) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + /** + * double decimal = 3; + * + * @return The decimal. + */ + public double getDecimal() { + if (dataCase_ == 3) { + return (Double) data_; + } + return 0D; + } + + /** + * double decimal = 3; + * + * @param value The decimal to set. + * @return This builder for chaining. + */ + public Builder setDecimal(double value) { + dataCase_ = 3; + data_ = value; + onChanged(); + return this; + } + + /** + * double decimal = 3; + * + * @return This builder for chaining. + */ + public Builder clearDecimal() { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Value) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Value) + private static final Value DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Value(); + } + + public static Value getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Value(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Value getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LogOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Log) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes payload = 1; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return The type. + */ + Log.Type getType(); + } + + /** + * Protobuf type {@code loggregator.v2.Log} + */ + public static final class Log extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Log) + LogOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Log.newBuilder() to construct. + private Log(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Log() { + payload_ = com.google.protobuf.ByteString.EMPTY; + type_ = 0; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Log(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Log( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + payload_ = input.readBytes(); + break; + } + case 16: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Log_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Log_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Log.class, Builder.class); + } + + /** + * Protobuf enum {@code loggregator.v2.Log.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + * OUT = 0; + */ + OUT(0), + /** + * ERR = 1; + */ + ERR(1), + UNRECOGNIZED(-1), + ; + + /** + * OUT = 0; + */ + public static final int OUT_VALUE = 0; + + /** + * ERR = 1; + */ + public static final int ERR_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return OUT; + case 1: + return ERR; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return Log.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:loggregator.v2.Log.Type) + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + + private com.google.protobuf.ByteString payload_; + + /** + * bytes payload = 1; + * + * @return The payload. + */ + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + public static final int TYPE_FIELD_NUMBER = 2; + + private int type_; + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + return type_; + } + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return The type. + */ + public Type getType() { + @SuppressWarnings("deprecation") + Type result = Type.valueOf(type_); + return result == null ? Type.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!payload_.isEmpty()) { + output.writeBytes(1, payload_); + } + if (type_ != Type.OUT.getNumber()) { + output.writeEnum(2, type_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, payload_); + } + if (type_ != Type.OUT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, type_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Log)) { + return super.equals(obj); + } + Log other = (Log) obj; + + if (!getPayload() + .equals(other.getPayload())) { + return false; + } + if (type_ != other.type_) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Log parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Log parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Log parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Log parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Log parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Log parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Log parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Log 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 Log parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Log 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 Log parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Log parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Log prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Log} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Log) + LogOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Log_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Log_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Log.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Log.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + payload_ = com.google.protobuf.ByteString.EMPTY; + + type_ = 0; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Log_descriptor; + } + + @Override + public Log getDefaultInstanceForType() { + return Log.getDefaultInstance(); + } + + @Override + public Log build() { + Log result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Log buildPartial() { + Log result = new Log(this); + result.payload_ = payload_; + result.type_ = type_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Log) { + return mergeFrom((Log) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Log other) { + if (other == Log.getDefaultInstance()) { + return this; + } + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Log parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Log) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes payload = 1; + * + * @return The payload. + */ + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * bytes payload = 1; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + payload_ = value; + onChanged(); + return this; + } + + /** + * bytes payload = 1; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + return type_; + } + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return The type. + */ + public Type getType() { + @SuppressWarnings("deprecation") + Type result = Type.valueOf(type_); + return result == null ? Type.UNRECOGNIZED : result; + } + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .loggregator.v2.Log.Type type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Log) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Log) + private static final Log DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Log(); + } + + public static Log getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Log parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Log(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Log getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CounterOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Counter) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * uint64 delta = 2; + * + * @return The delta. + */ + long getDelta(); + + /** + * uint64 total = 3; + * + * @return The total. + */ + long getTotal(); + } + + /** + * Protobuf type {@code loggregator.v2.Counter} + */ + public static final class Counter extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Counter) + CounterOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Counter.newBuilder() to construct. + private Counter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Counter() { + name_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Counter(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Counter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: { + + delta_ = input.readUInt64(); + break; + } + case 24: { + + total_ = input.readUInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Counter_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Counter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Counter.class, Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + private volatile Object name_; + + /** + * string name = 1; + * + * @return The name. + */ + public String getName() { + Object ref = name_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELTA_FIELD_NUMBER = 2; + + private long delta_; + + /** + * uint64 delta = 2; + * + * @return The delta. + */ + public long getDelta() { + return delta_; + } + + public static final int TOTAL_FIELD_NUMBER = 3; + + private long total_; + + /** + * uint64 total = 3; + * + * @return The total. + */ + public long getTotal() { + return total_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (delta_ != 0L) { + output.writeUInt64(2, delta_); + } + if (total_ != 0L) { + output.writeUInt64(3, total_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (delta_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, delta_); + } + if (total_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, total_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Counter)) { + return super.equals(obj); + } + Counter other = (Counter) obj; + + if (!getName() + .equals(other.getName())) { + return false; + } + if (getDelta() + != other.getDelta()) { + return false; + } + if (getTotal() + != other.getTotal()) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DELTA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDelta()); + hash = (37 * hash) + TOTAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotal()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Counter parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Counter parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Counter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Counter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Counter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Counter parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Counter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Counter 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 Counter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Counter 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 Counter parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Counter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Counter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Counter} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Counter) + CounterOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Counter_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Counter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Counter.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Counter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + name_ = ""; + + delta_ = 0L; + + total_ = 0L; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Counter_descriptor; + } + + @Override + public Counter getDefaultInstanceForType() { + return Counter.getDefaultInstance(); + } + + @Override + public Counter build() { + Counter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Counter buildPartial() { + Counter result = new Counter(this); + result.name_ = name_; + result.delta_ = delta_; + result.total_ = total_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Counter) { + return mergeFrom((Counter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Counter other) { + if (other == Counter.getDefaultInstance()) { + return this; + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getDelta() != 0L) { + setDelta(other.getDelta()); + } + if (other.getTotal() != 0L) { + setTotal(other.getTotal()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Counter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Counter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public String getName() { + Object ref = name_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private long delta_; + + /** + * uint64 delta = 2; + * + * @return The delta. + */ + public long getDelta() { + return delta_; + } + + /** + * uint64 delta = 2; + * + * @param value The delta to set. + * @return This builder for chaining. + */ + public Builder setDelta(long value) { + + delta_ = value; + onChanged(); + return this; + } + + /** + * uint64 delta = 2; + * + * @return This builder for chaining. + */ + public Builder clearDelta() { + + delta_ = 0L; + onChanged(); + return this; + } + + private long total_; + + /** + * uint64 total = 3; + * + * @return The total. + */ + public long getTotal() { + return total_; + } + + /** + * uint64 total = 3; + * + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(long value) { + + total_ = value; + onChanged(); + return this; + } + + /** + * uint64 total = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotal() { + + total_ = 0L; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Counter) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Counter) + private static final Counter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Counter(); + } + + public static Counter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Counter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Counter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Counter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GaugeOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Gauge) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + int getMetricsCount(); + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + boolean containsMetrics( + String key); + + /** + * Use {@link #getMetricsMap()} instead. + */ + @Deprecated + java.util.Map + getMetrics(); + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + java.util.Map + getMetricsMap(); + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + GaugeValue getMetricsOrDefault( + String key, + GaugeValue defaultValue); + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + GaugeValue getMetricsOrThrow( + String key); + } + + /** + * Protobuf type {@code loggregator.v2.Gauge} + */ + public static final class Gauge extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Gauge) + GaugeOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Gauge.newBuilder() to construct. + private Gauge(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Gauge() { + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Gauge(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Gauge( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metrics_ = com.google.protobuf.MapField.newMapField( + MetricsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metrics__ = input.readMessage( + MetricsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metrics_.getMutableMap().put( + metrics__.getKey(), metrics__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Gauge_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetMetrics(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Gauge_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Gauge.class, Builder.class); + } + + public static final int METRICS_FIELD_NUMBER = 1; + + private static final class MetricsDefaultEntryHolder { + + static final com.google.protobuf.MapEntry< + String, GaugeValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + LoggregatorEnvelope.internal_static_loggregator_v2_Gauge_MetricsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + GaugeValue.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + String, GaugeValue> metrics_; + + private com.google.protobuf.MapField + internalGetMetrics() { + if (metrics_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetricsDefaultEntryHolder.defaultEntry); + } + return metrics_; + } + + public int getMetricsCount() { + return internalGetMetrics().getMap().size(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public boolean containsMetrics( + String key) { + if (key == null) { + throw new NullPointerException(); + } + return internalGetMetrics().getMap().containsKey(key); + } + + /** + * Use {@link #getMetricsMap()} instead. + */ + @Deprecated + public java.util.Map getMetrics() { + return getMetricsMap(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public java.util.Map getMetricsMap() { + return internalGetMetrics().getMap(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public GaugeValue getMetricsOrDefault( + String key, + GaugeValue defaultValue) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetMetrics().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public GaugeValue getMetricsOrThrow( + String key) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetMetrics().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetrics(), + MetricsDefaultEntryHolder.defaultEntry, + 1); + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (java.util.Map.Entry entry + : internalGetMetrics().getMap().entrySet()) { + com.google.protobuf.MapEntry + metrics__ = MetricsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, metrics__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Gauge)) { + return super.equals(obj); + } + Gauge other = (Gauge) obj; + + if (!internalGetMetrics().equals( + other.internalGetMetrics())) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetMetrics().getMap().isEmpty()) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetrics().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Gauge parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Gauge parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Gauge parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Gauge parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Gauge parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Gauge parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Gauge parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Gauge 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 Gauge parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Gauge 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 Gauge parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Gauge parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Gauge prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Gauge} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Gauge) + GaugeOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Gauge_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetMetrics(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableMetrics(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Gauge_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Gauge.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Gauge.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + internalGetMutableMetrics().clear(); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Gauge_descriptor; + } + + @Override + public Gauge getDefaultInstanceForType() { + return Gauge.getDefaultInstance(); + } + + @Override + public Gauge build() { + Gauge result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Gauge buildPartial() { + Gauge result = new Gauge(this); + int from_bitField0_ = bitField0_; + result.metrics_ = internalGetMetrics(); + result.metrics_.makeImmutable(); + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Gauge) { + return mergeFrom((Gauge) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Gauge other) { + if (other == Gauge.getDefaultInstance()) { + return this; + } + internalGetMutableMetrics().mergeFrom( + other.internalGetMetrics()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Gauge parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Gauge) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + String, GaugeValue> metrics_; + + private com.google.protobuf.MapField + internalGetMetrics() { + if (metrics_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetricsDefaultEntryHolder.defaultEntry); + } + return metrics_; + } + + private com.google.protobuf.MapField + internalGetMutableMetrics() { + onChanged(); + ; + if (metrics_ == null) { + metrics_ = com.google.protobuf.MapField.newMapField( + MetricsDefaultEntryHolder.defaultEntry); + } + if (!metrics_.isMutable()) { + metrics_ = metrics_.copy(); + } + return metrics_; + } + + public int getMetricsCount() { + return internalGetMetrics().getMap().size(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public boolean containsMetrics( + String key) { + if (key == null) { + throw new NullPointerException(); + } + return internalGetMetrics().getMap().containsKey(key); + } + + /** + * Use {@link #getMetricsMap()} instead. + */ + @Deprecated + public java.util.Map getMetrics() { + return getMetricsMap(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public java.util.Map getMetricsMap() { + return internalGetMetrics().getMap(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public GaugeValue getMetricsOrDefault( + String key, + GaugeValue defaultValue) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetMetrics().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public GaugeValue getMetricsOrThrow( + String key) { + if (key == null) { + throw new NullPointerException(); + } + java.util.Map map = + internalGetMetrics().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetrics() { + internalGetMutableMetrics().getMutableMap() + .clear(); + return this; + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public Builder removeMetrics( + String key) { + if (key == null) { + throw new NullPointerException(); + } + internalGetMutableMetrics().getMutableMap() + .remove(key); + return this; + } + + /** + * Use alternate mutation accessors instead. + */ + @Deprecated + public java.util.Map + getMutableMetrics() { + return internalGetMutableMetrics().getMutableMap(); + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + public Builder putMetrics( + String key, + GaugeValue value) { + if (key == null) { + throw new NullPointerException(); + } + if (value == null) { + throw new NullPointerException(); + } + internalGetMutableMetrics().getMutableMap() + .put(key, value); + return this; + } + + /** + * map<string, .loggregator.v2.GaugeValue> metrics = 1; + */ + + public Builder putAllMetrics( + java.util.Map values) { + internalGetMutableMetrics().getMutableMap() + .putAll(values); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Gauge) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Gauge) + private static final Gauge DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Gauge(); + } + + public static Gauge getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Gauge parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Gauge(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Gauge getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GaugeValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.GaugeValue) + com.google.protobuf.MessageOrBuilder { + + /** + * string unit = 1; + * + * @return The unit. + */ + String getUnit(); + + /** + * string unit = 1; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString + getUnitBytes(); + + /** + * double value = 2; + * + * @return The value. + */ + double getValue(); + } + + /** + * Protobuf type {@code loggregator.v2.GaugeValue} + */ + public static final class GaugeValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.GaugeValue) + GaugeValueOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use GaugeValue.newBuilder() to construct. + private GaugeValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GaugeValue() { + unit_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new GaugeValue(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private GaugeValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + unit_ = s; + break; + } + case 17: { + + value_ = input.readDouble(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_GaugeValue_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_GaugeValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GaugeValue.class, Builder.class); + } + + public static final int UNIT_FIELD_NUMBER = 1; + + private volatile Object unit_; + + /** + * string unit = 1; + * + * @return The unit. + */ + public String getUnit() { + Object ref = unit_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + unit_ = s; + return s; + } + } + + /** + * string unit = 1; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString + getUnitBytes() { + Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + private double value_; + + /** + * double value = 2; + * + * @return The value. + */ + public double getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUnitBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, unit_); + } + if (value_ != 0D) { + output.writeDouble(2, value_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!getUnitBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, unit_); + } + if (value_ != 0D) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof GaugeValue)) { + return super.equals(obj); + } + GaugeValue other = (GaugeValue) obj; + + if (!getUnit() + .equals(other.getUnit())) { + return false; + } + if (Double.doubleToLongBits(getValue()) + != Double.doubleToLongBits( + other.getValue())) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getValue())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static GaugeValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static GaugeValue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static GaugeValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static GaugeValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static GaugeValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static GaugeValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static GaugeValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static GaugeValue 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 GaugeValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static GaugeValue 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 GaugeValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static GaugeValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GaugeValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.GaugeValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.GaugeValue) + GaugeValueOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_GaugeValue_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_GaugeValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GaugeValue.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.GaugeValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + unit_ = ""; + + value_ = 0D; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_GaugeValue_descriptor; + } + + @Override + public GaugeValue getDefaultInstanceForType() { + return GaugeValue.getDefaultInstance(); + } + + @Override + public GaugeValue build() { + GaugeValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public GaugeValue buildPartial() { + GaugeValue result = new GaugeValue(this); + result.unit_ = unit_; + result.value_ = value_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof GaugeValue) { + return mergeFrom((GaugeValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(GaugeValue other) { + if (other == GaugeValue.getDefaultInstance()) { + return this; + } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + onChanged(); + } + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + GaugeValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (GaugeValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private Object unit_ = ""; + + /** + * string unit = 1; + * + * @return The unit. + */ + public String getUnit() { + Object ref = unit_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string unit = 1; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString + getUnitBytes() { + Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string unit = 1; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value; + onChanged(); + return this; + } + + /** + * string unit = 1; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + + unit_ = getDefaultInstance().getUnit(); + onChanged(); + return this; + } + + /** + * string unit = 1; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + unit_ = value; + onChanged(); + return this; + } + + private double value_; + + /** + * double value = 2; + * + * @return The value. + */ + public double getValue() { + return value_; + } + + /** + * double value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + onChanged(); + return this; + } + + /** + * double value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = 0D; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.GaugeValue) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.GaugeValue) + private static final GaugeValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GaugeValue(); + } + + public static GaugeValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public GaugeValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GaugeValue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public GaugeValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TimerOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Timer) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * int64 start = 2; + * + * @return The start. + */ + long getStart(); + + /** + * int64 stop = 3; + * + * @return The stop. + */ + long getStop(); + } + + /** + * Protobuf type {@code loggregator.v2.Timer} + */ + public static final class Timer extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Timer) + TimerOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Timer.newBuilder() to construct. + private Timer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Timer() { + name_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Timer(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Timer( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: { + + start_ = input.readInt64(); + break; + } + case 24: { + + stop_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Timer_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Timer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Timer.class, Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + private volatile Object name_; + + /** + * string name = 1; + * + * @return The name. + */ + public String getName() { + Object ref = name_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_FIELD_NUMBER = 2; + + private long start_; + + /** + * int64 start = 2; + * + * @return The start. + */ + public long getStart() { + return start_; + } + + public static final int STOP_FIELD_NUMBER = 3; + + private long stop_; + + /** + * int64 stop = 3; + * + * @return The stop. + */ + public long getStop() { + return stop_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (start_ != 0L) { + output.writeInt64(2, start_); + } + if (stop_ != 0L) { + output.writeInt64(3, stop_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (start_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, start_); + } + if (stop_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, stop_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Timer)) { + return super.equals(obj); + } + Timer other = (Timer) obj; + + if (!getName() + .equals(other.getName())) { + return false; + } + if (getStart() + != other.getStart()) { + return false; + } + if (getStop() + != other.getStop()) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStart()); + hash = (37 * hash) + STOP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStop()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Timer parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Timer parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Timer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Timer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Timer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Timer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Timer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Timer 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 Timer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Timer 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 Timer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Timer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Timer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Timer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Timer) + TimerOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Timer_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Timer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Timer.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Timer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + name_ = ""; + + start_ = 0L; + + stop_ = 0L; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Timer_descriptor; + } + + @Override + public Timer getDefaultInstanceForType() { + return Timer.getDefaultInstance(); + } + + @Override + public Timer build() { + Timer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Timer buildPartial() { + Timer result = new Timer(this); + result.name_ = name_; + result.start_ = start_; + result.stop_ = stop_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Timer) { + return mergeFrom((Timer) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Timer other) { + if (other == Timer.getDefaultInstance()) { + return this; + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getStart() != 0L) { + setStart(other.getStart()); + } + if (other.getStop() != 0L) { + setStop(other.getStop()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Timer parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Timer) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public String getName() { + Object ref = name_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private long start_; + + /** + * int64 start = 2; + * + * @return The start. + */ + public long getStart() { + return start_; + } + + /** + * int64 start = 2; + * + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(long value) { + + start_ = value; + onChanged(); + return this; + } + + /** + * int64 start = 2; + * + * @return This builder for chaining. + */ + public Builder clearStart() { + + start_ = 0L; + onChanged(); + return this; + } + + private long stop_; + + /** + * int64 stop = 3; + * + * @return The stop. + */ + public long getStop() { + return stop_; + } + + /** + * int64 stop = 3; + * + * @param value The stop to set. + * @return This builder for chaining. + */ + public Builder setStop(long value) { + + stop_ = value; + onChanged(); + return this; + } + + /** + * int64 stop = 3; + * + * @return This builder for chaining. + */ + public Builder clearStop() { + + stop_ = 0L; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Timer) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Timer) + private static final Timer DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Timer(); + } + + public static Timer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Timer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Timer(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Timer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface EventOrBuilder extends + // @@protoc_insertion_point(interface_extends:loggregator.v2.Event) + com.google.protobuf.MessageOrBuilder { + + /** + * string title = 1; + * + * @return The title. + */ + String getTitle(); + + /** + * string title = 1; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string body = 2; + * + * @return The body. + */ + String getBody(); + + /** + * string body = 2; + * + * @return The bytes for body. + */ + com.google.protobuf.ByteString + getBodyBytes(); + } + + /** + * Protobuf type {@code loggregator.v2.Event} + */ + public static final class Event extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:loggregator.v2.Event) + EventOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Event() { + title_ = ""; + body_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Event(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + + private Event( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 18: { + String s = input.readStringRequireUtf8(); + + body_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Event_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Event.class, Builder.class); + } + + public static final int TITLE_FIELD_NUMBER = 1; + + private volatile Object title_; + + /** + * string title = 1; + * + * @return The title. + */ + public String getTitle() { + Object ref = title_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + + /** + * string title = 1; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString + getTitleBytes() { + Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 2; + + private volatile Object body_; + + /** + * string body = 2; + * + * @return The body. + */ + public String getBody() { + Object ref = body_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + body_ = s; + return s; + } + } + + /** + * string body = 2; + * + * @return The bytes for body. + */ + public com.google.protobuf.ByteString + getBodyBytes() { + Object ref = body_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_); + } + if (!getBodyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, body_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_); + } + if (!getBodyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, body_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Event)) { + return super.equals(obj); + } + Event other = (Event) obj; + + if (!getTitle() + .equals(other.getTitle())) { + return false; + } + if (!getBody() + .equals(other.getBody())) { + return false; + } + if (!unknownFields.equals(other.unknownFields)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Event parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Event parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Event parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Event parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Event parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Event parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Event parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Event 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 Event parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static Event 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 Event parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + + public static Event parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Event prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code loggregator.v2.Event} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:loggregator.v2.Event) + EventOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Event_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Event.class, Builder.class); + } + + // Construct using org.cloudfoundry.loggregator.v2.LoggregatorEnvelope.Event.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + title_ = ""; + + body_ = ""; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return LoggregatorEnvelope.internal_static_loggregator_v2_Event_descriptor; + } + + @Override + public Event getDefaultInstanceForType() { + return Event.getDefaultInstance(); + } + + @Override + public Event build() { + Event result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Event buildPartial() { + Event result = new Event(this); + result.title_ = title_; + result.body_ = body_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Event) { + return mergeFrom((Event) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Event other) { + if (other == Event.getDefaultInstance()) { + return this; + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getBody().isEmpty()) { + body_ = other.body_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Event parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Event) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private Object title_ = ""; + + /** + * string title = 1; + * + * @return The title. + */ + public String getTitle() { + Object ref = title_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string title = 1; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString + getTitleBytes() { + Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string title = 1; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + + /** + * string title = 1; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + + /** + * string title = 1; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private Object body_ = ""; + + /** + * string body = 2; + * + * @return The body. + */ + public String getBody() { + Object ref = body_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + body_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string body = 2; + * + * @return The bytes for body. + */ + public com.google.protobuf.ByteString + getBodyBytes() { + Object ref = body_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string body = 2; + * + * @param value The body to set. + * @return This builder for chaining. + */ + public Builder setBody( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + + /** + * string body = 2; + * + * @return This builder for chaining. + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + + /** + * string body = 2; + * + * @param value The bytes for body to set. + * @return This builder for chaining. + */ + public Builder setBodyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + body_ = value; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:loggregator.v2.Event) + } + + // @@protoc_insertion_point(class_scope:loggregator.v2.Event) + private static final Event DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Event(); + } + + public static Event getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + + @Override + public Event parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Event(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Event getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Envelope_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Envelope_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Envelope_DeprecatedTagsEntry_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Envelope_DeprecatedTagsEntry_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Envelope_TagsEntry_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Envelope_TagsEntry_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_EnvelopeBatch_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_EnvelopeBatch_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Value_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Value_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Log_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Log_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Counter_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Counter_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Gauge_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Gauge_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Gauge_MetricsEntry_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Gauge_MetricsEntry_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_GaugeValue_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_GaugeValue_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Timer_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Timer_fieldAccessorTable; + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_loggregator_v2_Event_descriptor; + + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_loggregator_v2_Event_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + + static { + String[] descriptorData = { + "\n\016envelope.proto\022\016loggregator.v2\"\265\004\n\010Env" + + "elope\022\021\n\ttimestamp\030\001 \001(\003\022\034\n\tsource_id\030\002 " + + "\001(\tR\tsource_id\022 \n\013instance_id\030\010 \001(\tR\013ins" + + "tance_id\022V\n\017deprecated_tags\030\003 \003(\0132,.logg" + + "regator.v2.Envelope.DeprecatedTagsEntryR" + + "\017deprecated_tags\0220\n\004tags\030\t \003(\0132\".loggreg" + + "ator.v2.Envelope.TagsEntry\022\"\n\003log\030\004 \001(\0132" + + "\023.loggregator.v2.LogH\000\022*\n\007counter\030\005 \001(\0132" + + "\027.loggregator.v2.CounterH\000\022&\n\005gauge\030\006 \001(" + + "\0132\025.loggregator.v2.GaugeH\000\022&\n\005timer\030\007 \001(" + + "\0132\025.loggregator.v2.TimerH\000\022&\n\005event\030\n \001(" + + "\0132\025.loggregator.v2.EventH\000\032L\n\023Deprecated" + + "TagsEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025." + + "loggregator.v2.Value:\0028\001\032+\n\tTagsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\t\n\007message" + + "\"8\n\rEnvelopeBatch\022\'\n\005batch\030\001 \003(\0132\030.loggr" + + "egator.v2.Envelope\"E\n\005Value\022\016\n\004text\030\001 \001(" + + "\tH\000\022\021\n\007integer\030\002 \001(\003H\000\022\021\n\007decimal\030\003 \001(\001H" + + "\000B\006\n\004data\"X\n\003Log\022\017\n\007payload\030\001 \001(\014\022&\n\004typ" + + "e\030\002 \001(\0162\030.loggregator.v2.Log.Type\"\030\n\004Typ" + + "e\022\007\n\003OUT\020\000\022\007\n\003ERR\020\001\"5\n\007Counter\022\014\n\004name\030\001" + + " \001(\t\022\r\n\005delta\030\002 \001(\004\022\r\n\005total\030\003 \001(\004\"\210\001\n\005G" + + "auge\0223\n\007metrics\030\001 \003(\0132\".loggregator.v2.G" + + "auge.MetricsEntry\032J\n\014MetricsEntry\022\013\n\003key" + + "\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.loggregator.v2.G" + + "augeValue:\0028\001\")\n\nGaugeValue\022\014\n\004unit\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\001\"2\n\005Timer\022\014\n\004name\030\001 \001(\t\022" + + "\r\n\005start\030\002 \001(\003\022\014\n\004stop\030\003 \001(\003\"$\n\005Event\022\r\n" + + "\005title\030\001 \001(\t\022\014\n\004body\030\002 \001(\tB6\n\037org.cloudf" + + "oundry.loggregator.v2B\023LoggregatorEnvelo" + + "peb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[]{ + }); + internal_static_loggregator_v2_Envelope_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_loggregator_v2_Envelope_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Envelope_descriptor, + new String[]{"Timestamp", "SourceId", "InstanceId", "DeprecatedTags", "Tags", "Log", "Counter", "Gauge", "Timer", "Event", "Message",}); + internal_static_loggregator_v2_Envelope_DeprecatedTagsEntry_descriptor = + internal_static_loggregator_v2_Envelope_descriptor.getNestedTypes().get(0); + internal_static_loggregator_v2_Envelope_DeprecatedTagsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Envelope_DeprecatedTagsEntry_descriptor, + new String[]{"Key", "Value",}); + internal_static_loggregator_v2_Envelope_TagsEntry_descriptor = + internal_static_loggregator_v2_Envelope_descriptor.getNestedTypes().get(1); + internal_static_loggregator_v2_Envelope_TagsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Envelope_TagsEntry_descriptor, + new String[]{"Key", "Value",}); + internal_static_loggregator_v2_EnvelopeBatch_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_loggregator_v2_EnvelopeBatch_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_EnvelopeBatch_descriptor, + new String[]{"Batch",}); + internal_static_loggregator_v2_Value_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_loggregator_v2_Value_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Value_descriptor, + new String[]{"Text", "Integer", "Decimal", "Data",}); + internal_static_loggregator_v2_Log_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_loggregator_v2_Log_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Log_descriptor, + new String[]{"Payload", "Type",}); + internal_static_loggregator_v2_Counter_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_loggregator_v2_Counter_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Counter_descriptor, + new String[]{"Name", "Delta", "Total",}); + internal_static_loggregator_v2_Gauge_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_loggregator_v2_Gauge_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Gauge_descriptor, + new String[]{"Metrics",}); + internal_static_loggregator_v2_Gauge_MetricsEntry_descriptor = + internal_static_loggregator_v2_Gauge_descriptor.getNestedTypes().get(0); + internal_static_loggregator_v2_Gauge_MetricsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Gauge_MetricsEntry_descriptor, + new String[]{"Key", "Value",}); + internal_static_loggregator_v2_GaugeValue_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_loggregator_v2_GaugeValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_GaugeValue_descriptor, + new String[]{"Unit", "Value",}); + internal_static_loggregator_v2_Timer_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_loggregator_v2_Timer_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Timer_descriptor, + new String[]{"Name", "Start", "Stop",}); + internal_static_loggregator_v2_Event_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_loggregator_v2_Event_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_loggregator_v2_Event_descriptor, + new String[]{"Title", "Body",}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/_StreamRequest.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/_StreamRequest.java new file mode 100644 index 00000000000..79d0f99bb95 --- /dev/null +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/loggregator/v2/_StreamRequest.java @@ -0,0 +1,58 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cloudfoundry.loggregator.v2; + +import org.cloudfoundry.Nullable; +import org.cloudfoundry.QueryParameter; +import org.immutables.value.Value; + +import java.util.List; + +/** + * The request payload for the Read endpoint + */ +@Value.Immutable +abstract class _StreamRequest { + + /** + * The source id + */ + @QueryParameter("source_id") + abstract List getSourceIds(); + + /** + * The log filter + */ + @QueryParameter("log") + @Nullable + abstract Boolean isLog(); + + /** + * The counter filter + */ + @QueryParameter("counter") + @Nullable + abstract Boolean isCounter(); + + /** + * The gauge filter + */ + @QueryParameter("gauge") + @Nullable + abstract Boolean isGauge(); + +} diff --git a/pom.xml b/pom.xml index 845f0c7daaf..0ff5ba7c417 100644 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,7 @@ 3.14.4 UTF-8 2.2.0 + 3.10.0 @@ -94,6 +95,16 @@ wire-runtime ${wire.version} + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.protobuf + protobuf-java-util + ${protobuf.version} + io.jsonwebtoken jjwt