diff --git a/alibabacloud-gateway-sls/Teafile b/alibabacloud-gateway-sls/Teafile index 6ac0e37d..26d337ec 100644 --- a/alibabacloud-gateway-sls/Teafile +++ b/alibabacloud-gateway-sls/Teafile @@ -1,7 +1,7 @@ { "scope": "alibabacloud", "name": "GatewaySLS", - "version": "0.1.1", + "version": "0.1.2", "main": "./main.tea", "maintainers": [ { @@ -92,7 +92,8 @@ }, "releaselog": { "changelog": [ - "[go/java]feat: support parsing compressed data." + "[go/java]feat: support parsing compressed data.", + "[java]feat: support pb serialization." ], "compatible": true } diff --git a/alibabacloud-gateway-sls/java/pom.xml b/alibabacloud-gateway-sls/java/pom.xml index bc0d8680..fe26502d 100644 --- a/alibabacloud-gateway-sls/java/pom.xml +++ b/alibabacloud-gateway-sls/java/pom.xml @@ -59,7 +59,7 @@ com.aliyun tea-util - 0.2.16 + 0.2.20 com.aliyun diff --git a/alibabacloud-gateway-sls/java/src/main/java/com/aliyun/gateway/sls/Client.java b/alibabacloud-gateway-sls/java/src/main/java/com/aliyun/gateway/sls/Client.java index 8a32c2fc..6ddb89ca 100644 --- a/alibabacloud-gateway-sls/java/src/main/java/com/aliyun/gateway/sls/Client.java +++ b/alibabacloud-gateway-sls/java/src/main/java/com/aliyun/gateway/sls/Client.java @@ -28,6 +28,7 @@ public void modifyRequest(com.aliyun.gateway.spi.models.InterceptorContext conte String accessKeyId = credential.getAccessKeyId(); String accessKeySecret = credential.getAccessKeySecret(); String securityToken = credential.getSecurityToken(); + String bodyRawSize = "0"; if (!com.aliyun.teautil.Common.empty(accessKeyId)) { request.headers.put("x-log-signaturemethod", "hmac-sha1"); } @@ -38,8 +39,12 @@ public void modifyRequest(com.aliyun.gateway.spi.models.InterceptorContext conte if (!com.aliyun.teautil.Common.isUnset(request.body)) { if (com.aliyun.darabonbastring.Client.equals(request.reqBodyType, "protobuf")) { - // var bodyMap = Util.assertAsMap(request.body); - // 缺少body的Content-MD5计算,以及protobuf处理 + byte[] serializedBody = com.aliyun.gateway.sls.util.Client.serializeLogGroupToPB(request.body); + bodyRawSize = com.aliyun.gateway.sls.util.Client.getBytesLength(serializedBody); + String compressType = request.headers.get("x-log-compresstype"); + byte[] compressedData = com.aliyun.gateway.sls.util.Client.readAndCompressBlock(serializedBody, compressType); + request.headers.put("content-md5", com.aliyun.darabonbastring.Client.toUpper(com.aliyun.darabonba.encode.Encoder.hexEncode(com.aliyun.darabonba.signature.Signer.MD5SignForBytes(compressedData)))); + request.stream = Tea.toReadable(compressedData); request.headers.put("content-type", "application/x-protobuf"); } else if (com.aliyun.darabonbastring.Client.equals(request.reqBodyType, "json")) { String bodyStr = com.aliyun.teautil.Common.toJSONString(request.body); @@ -63,7 +68,7 @@ public void modifyRequest(com.aliyun.gateway.spi.models.InterceptorContext conte new TeaPair("date", com.aliyun.teautil.Common.getDateUTCString()), new TeaPair("user-agent", request.userAgent), new TeaPair("x-log-apiversion", "0.6.0"), - new TeaPair("x-log-bodyrawsize", "0") + new TeaPair("x-log-bodyrawsize", bodyRawSize) ), request.headers ); diff --git a/alibabacloud-gateway-sls/main.tea b/alibabacloud-gateway-sls/main.tea index bd044640..b268f8b5 100644 --- a/alibabacloud-gateway-sls/main.tea +++ b/alibabacloud-gateway-sls/main.tea @@ -32,6 +32,7 @@ async function modifyRequest(context: SPI.InterceptorContext, attributeMap: SPI. var accessKeyId = credential.getAccessKeyId(); var accessKeySecret = credential.getAccessKeySecret(); var securityToken = credential.getSecurityToken(); + var bodyRawSize = '0'; if (!Util.empty(accessKeyId)) { request.headers['x-log-signaturemethod'] = 'hmac-sha1'; } @@ -40,8 +41,12 @@ async function modifyRequest(context: SPI.InterceptorContext, attributeMap: SPI. } if (!Util.isUnset(request.body)) { if (String.equals(request.reqBodyType, 'protobuf')) { - // var bodyMap = Util.assertAsMap(request.body); - // 缺少body的Content-MD5计算,以及protobuf处理 + var serializedBody = SLS_Util.serializeLogGroupToPB(request.body); + bodyRawSize = SLS_Util.getBytesLength(serializedBody); + var compressType = request.headers['x-log-compresstype']; + var compressedData = SLS_Util.readAndCompressBlock(serializedBody, compressType); + request.headers['content-md5'] = String.toUpper(EncodeUtil.hexEncode(SignatureUtil.MD5SignForBytes(compressedData))); + request.stream = compressedData; request.headers['content-type'] = 'application/x-protobuf'; } else if (String.equals(request.reqBodyType, 'json')) { var bodyStr = Util.toJSONString(request.body); @@ -62,7 +67,7 @@ async function modifyRequest(context: SPI.InterceptorContext, attributeMap: SPI. date = Util.getDateUTCString(), user-agent = request.userAgent, x-log-apiversion = '0.6.0', - x-log-bodyrawsize = '0', + x-log-bodyrawsize = bodyRawSize, ...request.headers }; request.headers['authorization'] = getAuthorization(request.pathname, request.method, request.query, request.headers, accessKeyId, accessKeySecret); diff --git a/alibabacloud-gateway-sls/util/Teafile b/alibabacloud-gateway-sls/util/Teafile index 1ba27db3..c6ac1195 100644 --- a/alibabacloud-gateway-sls/util/Teafile +++ b/alibabacloud-gateway-sls/util/Teafile @@ -1,7 +1,7 @@ { "scope": "alibabacloud", "name": "GatewaySLS_Util", - "version": "0.0.1", + "version": "0.0.2", "main": "./main.tea", "maintainers": [ { diff --git a/alibabacloud-gateway-sls/util/java/pom.xml b/alibabacloud-gateway-sls/util/java/pom.xml index 20f80911..cede2689 100644 --- a/alibabacloud-gateway-sls/util/java/pom.xml +++ b/alibabacloud-gateway-sls/util/java/pom.xml @@ -61,6 +61,11 @@ tea-util 0.2.14 + + com.google.protobuf + protobuf-java + 2.5.0 + diff --git a/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Client.java b/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Client.java index 582ec9fb..eecc57b9 100644 --- a/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Client.java +++ b/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Client.java @@ -1,8 +1,15 @@ // This file is auto-generated, don't edit it. Thanks. package com.aliyun.gateway.sls.util; +import com.aliyun.tea.TeaConverter; +import com.aliyun.tea.TeaException; +import com.aliyun.tea.TeaPair; + import java.io.ByteArrayInputStream; import java.io.InputStream; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.HashMap; public class Client { @@ -13,4 +20,76 @@ public static InputStream readAndUncompressBlock(InputStream stream, String comp String data = new String(rawData, "UTF-8"); return new ByteArrayInputStream(data.getBytes()); } -} \ No newline at end of file + + public static byte[] readAndCompressBlock(byte[] stream, String compressType) throws Exception { + byte[] compressedData = CompressorFactory.getCompressor(compressType).compress(stream); + return compressedData; + } + + public static byte[] serializeLogGroupToPB(Object logGroup) throws Exception { + byte[] logBytes = null; + Logs.LogGroup.Builder logs = Logs.LogGroup.newBuilder(); + HashMap body; + if (logGroup instanceof HashMap) { + body = (HashMap) logGroup; + } else { + throw new IllegalArgumentException("Invalid body type " + logGroup.getClass()); + } + + String topic = (String) body.get("Topic"); + if (topic != null) { + logs.setTopic((String) body.get("Topic")); + } else { + throw new IllegalArgumentException("Topic is null"); + } + String source = (String) body.get("Source"); + if (source != null) { + logs.setSource((String) body.get("Source")); + } else { + try { + logs.setSource(InetAddress.getLocalHost().getHostAddress()); + } catch (Exception e) {} + } + + ArrayList logTags = (ArrayList) body.get("LogTags"); + if (logTags != null && logTags.size() > 0) { + for (Object obj : logTags) { + HashMap tag = (HashMap) obj; + Logs.LogTag.Builder tagBuilder = logs.addLogTagsBuilder(); + tagBuilder.setKey(tag.get("Key")); + tagBuilder.setValue(tag.get("Value")); + } + } + ArrayList logItems = (ArrayList) body.get("Logs"); + for (Object obj : logItems) { + Logs.Log.Builder logsBuilder = logs.addLogsBuilder(); + HashMap logItem = (HashMap) obj; + logsBuilder.setTime((Integer) logItem.get("Time")); + ArrayList contents = (ArrayList) logItem.get("Contents"); + for (Object content : contents) { + HashMap realContent = (HashMap) content; + Logs.Log.Content.Builder contentBuilder = logsBuilder.addContentsBuilder(); + contentBuilder.setKey(realContent.get("Key")); + contentBuilder.setValue(realContent.get("Value")); + } + } + logBytes = logs.build().toByteArray(); + + int bodySize = logBytes.length; + if (bodySize > 50 * 1024 * 1024) { + throw new TeaException(TeaConverter.buildMap( + new TeaPair("code", "InvalidLogSize"), + new TeaPair("message", "logItems' size exceeds maximum limitation : " + 50 * 1024 * 1024 + " bytes"))); + } else if (bodySize > 10 * 1024 * 1024) { + throw new TeaException(TeaConverter.buildMap( + new TeaPair("code", "PostBodyTooLarge"), + new TeaPair("message", "body size " + bodySize + " must little than " + 10 * 1024 * 1024))); + } + + return logBytes; + } + + public static String getBytesLength(byte[] stream) throws Exception { + return String.valueOf(stream.length); + } +} diff --git a/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/CompressorFactory.java b/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/CompressorFactory.java new file mode 100644 index 00000000..63a3816e --- /dev/null +++ b/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/CompressorFactory.java @@ -0,0 +1,74 @@ +package com.aliyun.gateway.sls.util; + +import com.aliyun.tea.TeaConverter; +import com.aliyun.tea.TeaException; +import com.aliyun.tea.TeaPair; +import net.jpountz.lz4.LZ4Compressor; +import net.jpountz.lz4.LZ4Exception; +import net.jpountz.lz4.LZ4Factory; + +import java.io.ByteArrayOutputStream; +import java.util.zip.Deflater; + +interface Compressor { + byte[] compress(byte[] data) throws Exception; +} + +class Lz4Compressor implements Compressor { + @Override + public byte[] compress(byte[] data) { + final int rawSize = data.length; + LZ4Factory factory = LZ4Factory.fastestInstance(); + + // compress data + LZ4Compressor compressor = factory.fastCompressor(); + + int maxCompressedLength = compressor.maxCompressedLength(rawSize); + int encodingSize = 0; + byte[] rawCompressed = new byte[maxCompressedLength]; + try { + encodingSize = compressor.compress(data, 0, rawSize, rawCompressed, 0, maxCompressedLength); + } catch (LZ4Exception e) { + throw new TeaException(TeaConverter.buildMap(new TeaPair("CompressException", e.getMessage()))); + } + + if (encodingSize <= 0) { + throw new TeaException(TeaConverter.buildMap(new TeaPair("CompressException", "Invalid encoding size"))); + } + + byte[] ret = new byte[encodingSize]; + System.arraycopy(rawCompressed, 0, ret, 0, encodingSize); + + return ret; + } +} + +class GzipCompressor implements Compressor { + @Override + public byte[] compress(byte[] data) { + ByteArrayOutputStream out = new ByteArrayOutputStream(data.length); + Deflater compressor = new Deflater(); + try { + compressor.setInput(data); + compressor.finish(); + byte[] buf = new byte[10240]; + while (!compressor.finished()) { + int count = compressor.deflate(buf); + out.write(buf, 0, count); + } + return out.toByteArray(); + } finally { + compressor.end(); + } + } +} + +public class CompressorFactory { + public static Compressor getCompressor(String compressType) { + if ("lz4".equals(compressType)) { + return new Lz4Compressor(); + } + + throw new IllegalArgumentException("Invalid compressType: " + compressType); + } +} diff --git a/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Logs.java b/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Logs.java new file mode 100644 index 00000000..c9bedea4 --- /dev/null +++ b/alibabacloud-gateway-sls/util/java/src/main/java/com/aliyun/gateway/sls/util/Logs.java @@ -0,0 +1,4654 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Logs.proto + +package com.aliyun.gateway.sls.util; + +public final class Logs { + private Logs() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface LogOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required uint32 Time = 1; + /** + * required uint32 Time = 1; + * + *
+         * UNIX Time Format
+         * 
+ */ + boolean hasTime(); + /** + * required uint32 Time = 1; + * + *
+         * UNIX Time Format
+         * 
+ */ + int getTime(); + + // repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + java.util.List + getContentsList(); + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + com.aliyun.gateway.sls.util.Logs.Log.Content getContents(int index); + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + int getContentsCount(); + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + java.util.List + getContentsOrBuilderList(); + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder getContentsOrBuilder( + int index); + + // optional fixed32 Time_ns = 4; + /** + * optional fixed32 Time_ns = 4; + */ + boolean hasTimeNs(); + /** + * optional fixed32 Time_ns = 4; + */ + int getTimeNs(); + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.Log} + */ + public static final class Log extends + com.google.protobuf.GeneratedMessage + implements LogOrBuilder { + // Use Log.newBuilder() to construct. + private Log(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Log(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Log defaultInstance; + public static Log getDefaultInstance() { + return defaultInstance; + } + + public Log getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.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 { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + time_ = input.readUInt32(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + contents_.add(input.readMessage(com.aliyun.gateway.sls.util.Logs.Log.Content.PARSER, extensionRegistry)); + break; + } + case 37: { + bitField0_ |= 0x00000002; + timeNs_ = input.readFixed32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.Log.class, com.aliyun.gateway.sls.util.Logs.Log.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Log parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Log(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface ContentOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string Key = 1; + /** + * required string Key = 1; + */ + boolean hasKey(); + /** + * required string Key = 1; + */ + java.lang.String getKey(); + /** + * required string Key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + // required string Value = 2; + /** + * required string Value = 2; + */ + boolean hasValue(); + /** + * required string Value = 2; + */ + java.lang.String getValue(); + /** + * required string Value = 2; + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.Log.Content} + */ + public static final class Content extends + com.google.protobuf.GeneratedMessage + implements ContentOrBuilder { + // Use Content.newBuilder() to construct. + private Content(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Content(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Content defaultInstance; + public static Content getDefaultInstance() { + return defaultInstance; + } + + public Content getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Content( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + key_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + value_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_Content_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.Log.Content.class, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Content parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Content(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string Key = 1; + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.Object key_; + /** + * required string Key = 1; + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string Key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + /** + * required string Key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required string Value = 2; + public static final int VALUE_FIELD_NUMBER = 2; + private java.lang.Object value_; + /** + * required string Value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string Value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + /** + * required string Value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + key_ = ""; + value_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getValueBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getValueBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.Log.Content parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.aliyun.gateway.sls.util.Logs.Log.Content prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.Log.Content} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_Content_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.Log.Content.class, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder.class); + } + + // Construct using com.aliyun.gateway.sls.util.Logs.Log.Content.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + value_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_Content_descriptor; + } + + public com.aliyun.gateway.sls.util.Logs.Log.Content getDefaultInstanceForType() { + return com.aliyun.gateway.sls.util.Logs.Log.Content.getDefaultInstance(); + } + + public com.aliyun.gateway.sls.util.Logs.Log.Content build() { + com.aliyun.gateway.sls.util.Logs.Log.Content result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.aliyun.gateway.sls.util.Logs.Log.Content buildPartial() { + com.aliyun.gateway.sls.util.Logs.Log.Content result = new com.aliyun.gateway.sls.util.Logs.Log.Content(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.value_ = value_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.aliyun.gateway.sls.util.Logs.Log.Content) { + return mergeFrom((com.aliyun.gateway.sls.util.Logs.Log.Content)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.aliyun.gateway.sls.util.Logs.Log.Content other) { + if (other == com.aliyun.gateway.sls.util.Logs.Log.Content.getDefaultInstance()) return this; + if (other.hasKey()) { + bitField0_ |= 0x00000001; + key_ = other.key_; + onChanged(); + } + if (other.hasValue()) { + bitField0_ |= 0x00000002; + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasKey()) { + + return false; + } + if (!hasValue()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.aliyun.gateway.sls.util.Logs.Log.Content parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.aliyun.gateway.sls.util.Logs.Log.Content) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string Key = 1; + private java.lang.Object key_ = ""; + /** + * required string Key = 1; + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string Key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string Key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string Key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + /** + * required string Key = 1; + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * required string Key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + // required string Value = 2; + private java.lang.Object value_ = ""; + /** + * required string Value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string Value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string Value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string Value = 2; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + /** + * required string Value = 2; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * required string Value = 2; + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.aliyun.gateway.sls.util.Log.Content) + } + + static { + defaultInstance = new Content(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:com.aliyun.gateway.sls.util.Log.Content) + } + + private int bitField0_; + // required uint32 Time = 1; + public static final int TIME_FIELD_NUMBER = 1; + private int time_; + /** + * required uint32 Time = 1; + * + *
+         * UNIX Time Format
+         * 
+ */ + public boolean hasTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required uint32 Time = 1; + * + *
+         * UNIX Time Format
+         * 
+ */ + public int getTime() { + return time_; + } + + // repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + public static final int CONTENTS_FIELD_NUMBER = 2; + private java.util.List contents_; + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public java.util.List getContentsList() { + return contents_; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public java.util.List + getContentsOrBuilderList() { + return contents_; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public int getContentsCount() { + return contents_.size(); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Content getContents(int index) { + return contents_.get(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder getContentsOrBuilder( + int index) { + return contents_.get(index); + } + + // optional fixed32 Time_ns = 4; + public static final int TIME_NS_FIELD_NUMBER = 4; + private int timeNs_; + /** + * optional fixed32 Time_ns = 4; + */ + public boolean hasTimeNs() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional fixed32 Time_ns = 4; + */ + public int getTimeNs() { + return timeNs_; + } + + private void initFields() { + time_ = 0; + contents_ = java.util.Collections.emptyList(); + timeNs_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasTime()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getContentsCount(); i++) { + if (!getContents(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt32(1, time_); + } + for (int i = 0; i < contents_.size(); i++) { + output.writeMessage(2, contents_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeFixed32(4, timeNs_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, time_); + } + for (int i = 0; i < contents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, contents_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(4, timeNs_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.Log parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.aliyun.gateway.sls.util.Logs.Log prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.Log} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.aliyun.gateway.sls.util.Logs.LogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.Log.class, com.aliyun.gateway.sls.util.Logs.Log.Builder.class); + } + + // Construct using com.aliyun.gateway.sls.util.Logs.Log.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getContentsFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + time_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + contentsBuilder_.clear(); + } + timeNs_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_Log_descriptor; + } + + public com.aliyun.gateway.sls.util.Logs.Log getDefaultInstanceForType() { + return com.aliyun.gateway.sls.util.Logs.Log.getDefaultInstance(); + } + + public com.aliyun.gateway.sls.util.Logs.Log build() { + com.aliyun.gateway.sls.util.Logs.Log result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.aliyun.gateway.sls.util.Logs.Log buildPartial() { + com.aliyun.gateway.sls.util.Logs.Log result = new com.aliyun.gateway.sls.util.Logs.Log(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.time_ = time_; + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.contents_ = contents_; + } else { + result.contents_ = contentsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.timeNs_ = timeNs_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.aliyun.gateway.sls.util.Logs.Log) { + return mergeFrom((com.aliyun.gateway.sls.util.Logs.Log)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.aliyun.gateway.sls.util.Logs.Log other) { + if (other == com.aliyun.gateway.sls.util.Logs.Log.getDefaultInstance()) return this; + if (other.hasTime()) { + setTime(other.getTime()); + } + if (contentsBuilder_ == null) { + if (!other.contents_.isEmpty()) { + if (contents_.isEmpty()) { + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureContentsIsMutable(); + contents_.addAll(other.contents_); + } + onChanged(); + } + } else { + if (!other.contents_.isEmpty()) { + if (contentsBuilder_.isEmpty()) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000002); + contentsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getContentsFieldBuilder() : null; + } else { + contentsBuilder_.addAllMessages(other.contents_); + } + } + } + if (other.hasTimeNs()) { + setTimeNs(other.getTimeNs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasTime()) { + + return false; + } + for (int i = 0; i < getContentsCount(); i++) { + if (!getContents(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.aliyun.gateway.sls.util.Logs.Log parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.aliyun.gateway.sls.util.Logs.Log) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required uint32 Time = 1; + private int time_ ; + /** + * required uint32 Time = 1; + * + *
+             * UNIX Time Format
+             * 
+ */ + public boolean hasTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required uint32 Time = 1; + * + *
+             * UNIX Time Format
+             * 
+ */ + public int getTime() { + return time_; + } + /** + * required uint32 Time = 1; + * + *
+             * UNIX Time Format
+             * 
+ */ + public Builder setTime(int value) { + bitField0_ |= 0x00000001; + time_ = value; + onChanged(); + return this; + } + /** + * required uint32 Time = 1; + * + *
+             * UNIX Time Format
+             * 
+ */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0; + onChanged(); + return this; + } + + // repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + private java.util.List contents_ = + java.util.Collections.emptyList(); + private void ensureContentsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = new java.util.ArrayList(contents_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.Log.Content, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder, com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder> contentsBuilder_; + + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public java.util.List getContentsList() { + if (contentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contents_); + } else { + return contentsBuilder_.getMessageList(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public int getContentsCount() { + if (contentsBuilder_ == null) { + return contents_.size(); + } else { + return contentsBuilder_.getCount(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Content getContents(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessage(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder setContents( + int index, com.aliyun.gateway.sls.util.Logs.Log.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.set(index, value); + onChanged(); + } else { + contentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder setContents( + int index, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.set(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder addContents(com.aliyun.gateway.sls.util.Logs.Log.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(value); + onChanged(); + } else { + contentsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder addContents( + int index, com.aliyun.gateway.sls.util.Logs.Log.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(index, value); + onChanged(); + } else { + contentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder addContents( + com.aliyun.gateway.sls.util.Logs.Log.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder addContents( + int index, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder addAllContents( + java.lang.Iterable values) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + super.addAll(values, contents_); + onChanged(); + } else { + contentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder clearContents() { + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + contentsBuilder_.clear(); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public Builder removeContents(int index) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.remove(index); + onChanged(); + } else { + contentsBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Content.Builder getContentsBuilder( + int index) { + return getContentsFieldBuilder().getBuilder(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder getContentsOrBuilder( + int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); } else { + return contentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public java.util.List + getContentsOrBuilderList() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contents_); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Content.Builder addContentsBuilder() { + return getContentsFieldBuilder().addBuilder( + com.aliyun.gateway.sls.util.Logs.Log.Content.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Content.Builder addContentsBuilder( + int index) { + return getContentsFieldBuilder().addBuilder( + index, com.aliyun.gateway.sls.util.Logs.Log.Content.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log.Content Contents = 2; + */ + public java.util.List + getContentsBuilderList() { + return getContentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.Log.Content, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder, com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.Log.Content, com.aliyun.gateway.sls.util.Logs.Log.Content.Builder, com.aliyun.gateway.sls.util.Logs.Log.ContentOrBuilder>( + contents_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + contents_ = null; + } + return contentsBuilder_; + } + + // optional fixed32 Time_ns = 4; + private int timeNs_ ; + /** + * optional fixed32 Time_ns = 4; + */ + public boolean hasTimeNs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional fixed32 Time_ns = 4; + */ + public int getTimeNs() { + return timeNs_; + } + /** + * optional fixed32 Time_ns = 4; + */ + public Builder setTimeNs(int value) { + bitField0_ |= 0x00000004; + timeNs_ = value; + onChanged(); + return this; + } + /** + * optional fixed32 Time_ns = 4; + */ + public Builder clearTimeNs() { + bitField0_ = (bitField0_ & ~0x00000004); + timeNs_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.aliyun.gateway.sls.util.Log) + } + + static { + defaultInstance = new Log(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:com.aliyun.gateway.sls.util.Log) + } + + public interface LogTagOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string Key = 1; + /** + * required string Key = 1; + */ + boolean hasKey(); + /** + * required string Key = 1; + */ + java.lang.String getKey(); + /** + * required string Key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + // required string Value = 2; + /** + * required string Value = 2; + */ + boolean hasValue(); + /** + * required string Value = 2; + */ + java.lang.String getValue(); + /** + * required string Value = 2; + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.LogTag} + */ + public static final class LogTag extends + com.google.protobuf.GeneratedMessage + implements LogTagOrBuilder { + // Use LogTag.newBuilder() to construct. + private LogTag(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private LogTag(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final LogTag defaultInstance; + public static LogTag getDefaultInstance() { + return defaultInstance; + } + + public LogTag getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogTag( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + key_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + value_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogTag_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogTag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.LogTag.class, com.aliyun.gateway.sls.util.Logs.LogTag.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public LogTag parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogTag(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string Key = 1; + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.Object key_; + /** + * required string Key = 1; + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string Key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + /** + * required string Key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required string Value = 2; + public static final int VALUE_FIELD_NUMBER = 2; + private java.lang.Object value_; + /** + * required string Value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string Value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + /** + * required string Value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + key_ = ""; + value_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getValueBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getValueBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogTag parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.aliyun.gateway.sls.util.Logs.LogTag prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.LogTag} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogTag_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogTag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.LogTag.class, com.aliyun.gateway.sls.util.Logs.LogTag.Builder.class); + } + + // Construct using com.aliyun.gateway.sls.util.Logs.LogTag.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + value_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogTag_descriptor; + } + + public com.aliyun.gateway.sls.util.Logs.LogTag getDefaultInstanceForType() { + return com.aliyun.gateway.sls.util.Logs.LogTag.getDefaultInstance(); + } + + public com.aliyun.gateway.sls.util.Logs.LogTag build() { + com.aliyun.gateway.sls.util.Logs.LogTag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.aliyun.gateway.sls.util.Logs.LogTag buildPartial() { + com.aliyun.gateway.sls.util.Logs.LogTag result = new com.aliyun.gateway.sls.util.Logs.LogTag(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.value_ = value_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.aliyun.gateway.sls.util.Logs.LogTag) { + return mergeFrom((com.aliyun.gateway.sls.util.Logs.LogTag)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.aliyun.gateway.sls.util.Logs.LogTag other) { + if (other == com.aliyun.gateway.sls.util.Logs.LogTag.getDefaultInstance()) return this; + if (other.hasKey()) { + bitField0_ |= 0x00000001; + key_ = other.key_; + onChanged(); + } + if (other.hasValue()) { + bitField0_ |= 0x00000002; + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasKey()) { + + return false; + } + if (!hasValue()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.aliyun.gateway.sls.util.Logs.LogTag parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.aliyun.gateway.sls.util.Logs.LogTag) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string Key = 1; + private java.lang.Object key_ = ""; + /** + * required string Key = 1; + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string Key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string Key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string Key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + /** + * required string Key = 1; + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * required string Key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + // required string Value = 2; + private java.lang.Object value_ = ""; + /** + * required string Value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string Value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string Value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string Value = 2; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + /** + * required string Value = 2; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * required string Value = 2; + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.aliyun.gateway.sls.util.LogTag) + } + + static { + defaultInstance = new LogTag(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:com.aliyun.gateway.sls.util.LogTag) + } + + public interface LogGroupOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + java.util.List + getLogsList(); + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + com.aliyun.gateway.sls.util.Logs.Log getLogs(int index); + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + int getLogsCount(); + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + java.util.List + getLogsOrBuilderList(); + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + com.aliyun.gateway.sls.util.Logs.LogOrBuilder getLogsOrBuilder( + int index); + + // optional string Category = 2; + /** + * optional string Category = 2; + */ + boolean hasCategory(); + /** + * optional string Category = 2; + */ + java.lang.String getCategory(); + /** + * optional string Category = 2; + */ + com.google.protobuf.ByteString + getCategoryBytes(); + + // optional string Topic = 3; + /** + * optional string Topic = 3; + */ + boolean hasTopic(); + /** + * optional string Topic = 3; + */ + java.lang.String getTopic(); + /** + * optional string Topic = 3; + */ + com.google.protobuf.ByteString + getTopicBytes(); + + // optional string Source = 4; + /** + * optional string Source = 4; + */ + boolean hasSource(); + /** + * optional string Source = 4; + */ + java.lang.String getSource(); + /** + * optional string Source = 4; + */ + com.google.protobuf.ByteString + getSourceBytes(); + + // optional string MachineUUID = 5; + /** + * optional string MachineUUID = 5; + */ + boolean hasMachineUUID(); + /** + * optional string MachineUUID = 5; + */ + java.lang.String getMachineUUID(); + /** + * optional string MachineUUID = 5; + */ + com.google.protobuf.ByteString + getMachineUUIDBytes(); + + // repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + java.util.List + getLogTagsList(); + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + com.aliyun.gateway.sls.util.Logs.LogTag getLogTags(int index); + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + int getLogTagsCount(); + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + java.util.List + getLogTagsOrBuilderList(); + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder getLogTagsOrBuilder( + int index); + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.LogGroup} + */ + public static final class LogGroup extends + com.google.protobuf.GeneratedMessage + implements LogGroupOrBuilder { + // Use LogGroup.newBuilder() to construct. + private LogGroup(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private LogGroup(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final LogGroup defaultInstance; + public static LogGroup getDefaultInstance() { + return defaultInstance; + } + + public LogGroup getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogGroup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + logs_.add(input.readMessage(com.aliyun.gateway.sls.util.Logs.Log.PARSER, extensionRegistry)); + break; + } + case 18: { + bitField0_ |= 0x00000001; + category_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000002; + topic_ = input.readBytes(); + break; + } + case 34: { + bitField0_ |= 0x00000004; + source_ = input.readBytes(); + break; + } + case 42: { + bitField0_ |= 0x00000008; + machineUUID_ = input.readBytes(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + logTags_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + logTags_.add(input.readMessage(com.aliyun.gateway.sls.util.Logs.LogTag.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logs_ = java.util.Collections.unmodifiableList(logs_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + logTags_ = java.util.Collections.unmodifiableList(logTags_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroup_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.LogGroup.class, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public LogGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogGroup(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + public static final int LOGS_FIELD_NUMBER = 1; + private java.util.List logs_; + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public java.util.List getLogsList() { + return logs_; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public java.util.List + getLogsOrBuilderList() { + return logs_; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public int getLogsCount() { + return logs_.size(); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.Log getLogs(int index) { + return logs_.get(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogOrBuilder getLogsOrBuilder( + int index) { + return logs_.get(index); + } + + // optional string Category = 2; + public static final int CATEGORY_FIELD_NUMBER = 2; + private java.lang.Object category_; + /** + * optional string Category = 2; + */ + public boolean hasCategory() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string Category = 2; + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + category_ = s; + } + return s; + } + } + /** + * optional string Category = 2; + */ + public com.google.protobuf.ByteString + getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional string Topic = 3; + public static final int TOPIC_FIELD_NUMBER = 3; + private java.lang.Object topic_; + /** + * optional string Topic = 3; + */ + public boolean hasTopic() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string Topic = 3; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + topic_ = s; + } + return s; + } + } + /** + * optional string Topic = 3; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional string Source = 4; + public static final int SOURCE_FIELD_NUMBER = 4; + private java.lang.Object source_; + /** + * optional string Source = 4; + */ + public boolean hasSource() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string Source = 4; + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + source_ = s; + } + return s; + } + } + /** + * optional string Source = 4; + */ + public com.google.protobuf.ByteString + getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional string MachineUUID = 5; + public static final int MACHINEUUID_FIELD_NUMBER = 5; + private java.lang.Object machineUUID_; + /** + * optional string MachineUUID = 5; + */ + public boolean hasMachineUUID() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string MachineUUID = 5; + */ + public java.lang.String getMachineUUID() { + java.lang.Object ref = machineUUID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + machineUUID_ = s; + } + return s; + } + } + /** + * optional string MachineUUID = 5; + */ + public com.google.protobuf.ByteString + getMachineUUIDBytes() { + java.lang.Object ref = machineUUID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + machineUUID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + public static final int LOGTAGS_FIELD_NUMBER = 6; + private java.util.List logTags_; + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public java.util.List getLogTagsList() { + return logTags_; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public java.util.List + getLogTagsOrBuilderList() { + return logTags_; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public int getLogTagsCount() { + return logTags_.size(); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTag getLogTags(int index) { + return logTags_.get(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder getLogTagsOrBuilder( + int index) { + return logTags_.get(index); + } + + private void initFields() { + logs_ = java.util.Collections.emptyList(); + category_ = ""; + topic_ = ""; + source_ = ""; + machineUUID_ = ""; + logTags_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + for (int i = 0; i < getLogsCount(); i++) { + if (!getLogs(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getLogTagsCount(); i++) { + if (!getLogTags(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < logs_.size(); i++) { + output.writeMessage(1, logs_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(2, getCategoryBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(3, getTopicBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(4, getSourceBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(5, getMachineUUIDBytes()); + } + for (int i = 0; i < logTags_.size(); i++) { + output.writeMessage(6, logTags_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < logs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, logs_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getCategoryBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getTopicBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, getSourceBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getMachineUUIDBytes()); + } + for (int i = 0; i < logTags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, logTags_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.aliyun.gateway.sls.util.Logs.LogGroup prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.LogGroup} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroup_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.LogGroup.class, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder.class); + } + + // Construct using com.aliyun.gateway.sls.util.Logs.LogGroup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getLogsFieldBuilder(); + getLogTagsFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (logsBuilder_ == null) { + logs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + logsBuilder_.clear(); + } + category_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + topic_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + source_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + machineUUID_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + if (logTagsBuilder_ == null) { + logTags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + logTagsBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroup_descriptor; + } + + public com.aliyun.gateway.sls.util.Logs.LogGroup getDefaultInstanceForType() { + return com.aliyun.gateway.sls.util.Logs.LogGroup.getDefaultInstance(); + } + + public com.aliyun.gateway.sls.util.Logs.LogGroup build() { + com.aliyun.gateway.sls.util.Logs.LogGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.aliyun.gateway.sls.util.Logs.LogGroup buildPartial() { + com.aliyun.gateway.sls.util.Logs.LogGroup result = new com.aliyun.gateway.sls.util.Logs.LogGroup(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (logsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + logs_ = java.util.Collections.unmodifiableList(logs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.logs_ = logs_; + } else { + result.logs_ = logsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000001; + } + result.category_ = category_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.topic_ = topic_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.source_ = source_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.machineUUID_ = machineUUID_; + if (logTagsBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { + logTags_ = java.util.Collections.unmodifiableList(logTags_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.logTags_ = logTags_; + } else { + result.logTags_ = logTagsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.aliyun.gateway.sls.util.Logs.LogGroup) { + return mergeFrom((com.aliyun.gateway.sls.util.Logs.LogGroup)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.aliyun.gateway.sls.util.Logs.LogGroup other) { + if (other == com.aliyun.gateway.sls.util.Logs.LogGroup.getDefaultInstance()) return this; + if (logsBuilder_ == null) { + if (!other.logs_.isEmpty()) { + if (logs_.isEmpty()) { + logs_ = other.logs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLogsIsMutable(); + logs_.addAll(other.logs_); + } + onChanged(); + } + } else { + if (!other.logs_.isEmpty()) { + if (logsBuilder_.isEmpty()) { + logsBuilder_.dispose(); + logsBuilder_ = null; + logs_ = other.logs_; + bitField0_ = (bitField0_ & ~0x00000001); + logsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLogsFieldBuilder() : null; + } else { + logsBuilder_.addAllMessages(other.logs_); + } + } + } + if (other.hasCategory()) { + bitField0_ |= 0x00000002; + category_ = other.category_; + onChanged(); + } + if (other.hasTopic()) { + bitField0_ |= 0x00000004; + topic_ = other.topic_; + onChanged(); + } + if (other.hasSource()) { + bitField0_ |= 0x00000008; + source_ = other.source_; + onChanged(); + } + if (other.hasMachineUUID()) { + bitField0_ |= 0x00000010; + machineUUID_ = other.machineUUID_; + onChanged(); + } + if (logTagsBuilder_ == null) { + if (!other.logTags_.isEmpty()) { + if (logTags_.isEmpty()) { + logTags_ = other.logTags_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureLogTagsIsMutable(); + logTags_.addAll(other.logTags_); + } + onChanged(); + } + } else { + if (!other.logTags_.isEmpty()) { + if (logTagsBuilder_.isEmpty()) { + logTagsBuilder_.dispose(); + logTagsBuilder_ = null; + logTags_ = other.logTags_; + bitField0_ = (bitField0_ & ~0x00000020); + logTagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLogTagsFieldBuilder() : null; + } else { + logTagsBuilder_.addAllMessages(other.logTags_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getLogsCount(); i++) { + if (!getLogs(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getLogTagsCount(); i++) { + if (!getLogTags(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.aliyun.gateway.sls.util.Logs.LogGroup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.aliyun.gateway.sls.util.Logs.LogGroup) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + private java.util.List logs_ = + java.util.Collections.emptyList(); + private void ensureLogsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + logs_ = new java.util.ArrayList(logs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.Log, com.aliyun.gateway.sls.util.Logs.Log.Builder, com.aliyun.gateway.sls.util.Logs.LogOrBuilder> logsBuilder_; + + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public java.util.List getLogsList() { + if (logsBuilder_ == null) { + return java.util.Collections.unmodifiableList(logs_); + } else { + return logsBuilder_.getMessageList(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public int getLogsCount() { + if (logsBuilder_ == null) { + return logs_.size(); + } else { + return logsBuilder_.getCount(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.Log getLogs(int index) { + if (logsBuilder_ == null) { + return logs_.get(index); + } else { + return logsBuilder_.getMessage(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder setLogs( + int index, com.aliyun.gateway.sls.util.Logs.Log value) { + if (logsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogsIsMutable(); + logs_.set(index, value); + onChanged(); + } else { + logsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder setLogs( + int index, com.aliyun.gateway.sls.util.Logs.Log.Builder builderForValue) { + if (logsBuilder_ == null) { + ensureLogsIsMutable(); + logs_.set(index, builderForValue.build()); + onChanged(); + } else { + logsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder addLogs(com.aliyun.gateway.sls.util.Logs.Log value) { + if (logsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogsIsMutable(); + logs_.add(value); + onChanged(); + } else { + logsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder addLogs( + int index, com.aliyun.gateway.sls.util.Logs.Log value) { + if (logsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogsIsMutable(); + logs_.add(index, value); + onChanged(); + } else { + logsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder addLogs( + com.aliyun.gateway.sls.util.Logs.Log.Builder builderForValue) { + if (logsBuilder_ == null) { + ensureLogsIsMutable(); + logs_.add(builderForValue.build()); + onChanged(); + } else { + logsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder addLogs( + int index, com.aliyun.gateway.sls.util.Logs.Log.Builder builderForValue) { + if (logsBuilder_ == null) { + ensureLogsIsMutable(); + logs_.add(index, builderForValue.build()); + onChanged(); + } else { + logsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder addAllLogs( + java.lang.Iterable values) { + if (logsBuilder_ == null) { + ensureLogsIsMutable(); + super.addAll(values, logs_); + onChanged(); + } else { + logsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder clearLogs() { + if (logsBuilder_ == null) { + logs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + logsBuilder_.clear(); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public Builder removeLogs(int index) { + if (logsBuilder_ == null) { + ensureLogsIsMutable(); + logs_.remove(index); + onChanged(); + } else { + logsBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Builder getLogsBuilder( + int index) { + return getLogsFieldBuilder().getBuilder(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogOrBuilder getLogsOrBuilder( + int index) { + if (logsBuilder_ == null) { + return logs_.get(index); } else { + return logsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public java.util.List + getLogsOrBuilderList() { + if (logsBuilder_ != null) { + return logsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logs_); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Builder addLogsBuilder() { + return getLogsFieldBuilder().addBuilder( + com.aliyun.gateway.sls.util.Logs.Log.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public com.aliyun.gateway.sls.util.Logs.Log.Builder addLogsBuilder( + int index) { + return getLogsFieldBuilder().addBuilder( + index, com.aliyun.gateway.sls.util.Logs.Log.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.Log Logs = 1; + */ + public java.util.List + getLogsBuilderList() { + return getLogsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.Log, com.aliyun.gateway.sls.util.Logs.Log.Builder, com.aliyun.gateway.sls.util.Logs.LogOrBuilder> + getLogsFieldBuilder() { + if (logsBuilder_ == null) { + logsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.Log, com.aliyun.gateway.sls.util.Logs.Log.Builder, com.aliyun.gateway.sls.util.Logs.LogOrBuilder>( + logs_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + logs_ = null; + } + return logsBuilder_; + } + + // optional string Category = 2; + private java.lang.Object category_ = ""; + /** + * optional string Category = 2; + */ + public boolean hasCategory() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string Category = 2; + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string Category = 2; + */ + public com.google.protobuf.ByteString + getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string Category = 2; + */ + public Builder setCategory( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + category_ = value; + onChanged(); + return this; + } + /** + * optional string Category = 2; + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000002); + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; + } + /** + * optional string Category = 2; + */ + public Builder setCategoryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + category_ = value; + onChanged(); + return this; + } + + // optional string Topic = 3; + private java.lang.Object topic_ = ""; + /** + * optional string Topic = 3; + */ + public boolean hasTopic() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string Topic = 3; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string Topic = 3; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string Topic = 3; + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + topic_ = value; + onChanged(); + return this; + } + /** + * optional string Topic = 3; + */ + public Builder clearTopic() { + bitField0_ = (bitField0_ & ~0x00000004); + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + * optional string Topic = 3; + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + topic_ = value; + onChanged(); + return this; + } + + // optional string Source = 4; + private java.lang.Object source_ = ""; + /** + * optional string Source = 4; + */ + public boolean hasSource() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string Source = 4; + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + source_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string Source = 4; + */ + public com.google.protobuf.ByteString + getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string Source = 4; + */ + public Builder setSource( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + source_ = value; + onChanged(); + return this; + } + /** + * optional string Source = 4; + */ + public Builder clearSource() { + bitField0_ = (bitField0_ & ~0x00000008); + source_ = getDefaultInstance().getSource(); + onChanged(); + return this; + } + /** + * optional string Source = 4; + */ + public Builder setSourceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + source_ = value; + onChanged(); + return this; + } + + // optional string MachineUUID = 5; + private java.lang.Object machineUUID_ = ""; + /** + * optional string MachineUUID = 5; + */ + public boolean hasMachineUUID() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string MachineUUID = 5; + */ + public java.lang.String getMachineUUID() { + java.lang.Object ref = machineUUID_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + machineUUID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string MachineUUID = 5; + */ + public com.google.protobuf.ByteString + getMachineUUIDBytes() { + java.lang.Object ref = machineUUID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + machineUUID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string MachineUUID = 5; + */ + public Builder setMachineUUID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + machineUUID_ = value; + onChanged(); + return this; + } + /** + * optional string MachineUUID = 5; + */ + public Builder clearMachineUUID() { + bitField0_ = (bitField0_ & ~0x00000010); + machineUUID_ = getDefaultInstance().getMachineUUID(); + onChanged(); + return this; + } + /** + * optional string MachineUUID = 5; + */ + public Builder setMachineUUIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + machineUUID_ = value; + onChanged(); + return this; + } + + // repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + private java.util.List logTags_ = + java.util.Collections.emptyList(); + private void ensureLogTagsIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + logTags_ = new java.util.ArrayList(logTags_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.LogTag, com.aliyun.gateway.sls.util.Logs.LogTag.Builder, com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder> logTagsBuilder_; + + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public java.util.List getLogTagsList() { + if (logTagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(logTags_); + } else { + return logTagsBuilder_.getMessageList(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public int getLogTagsCount() { + if (logTagsBuilder_ == null) { + return logTags_.size(); + } else { + return logTagsBuilder_.getCount(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTag getLogTags(int index) { + if (logTagsBuilder_ == null) { + return logTags_.get(index); + } else { + return logTagsBuilder_.getMessage(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder setLogTags( + int index, com.aliyun.gateway.sls.util.Logs.LogTag value) { + if (logTagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogTagsIsMutable(); + logTags_.set(index, value); + onChanged(); + } else { + logTagsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder setLogTags( + int index, com.aliyun.gateway.sls.util.Logs.LogTag.Builder builderForValue) { + if (logTagsBuilder_ == null) { + ensureLogTagsIsMutable(); + logTags_.set(index, builderForValue.build()); + onChanged(); + } else { + logTagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder addLogTags(com.aliyun.gateway.sls.util.Logs.LogTag value) { + if (logTagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogTagsIsMutable(); + logTags_.add(value); + onChanged(); + } else { + logTagsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder addLogTags( + int index, com.aliyun.gateway.sls.util.Logs.LogTag value) { + if (logTagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogTagsIsMutable(); + logTags_.add(index, value); + onChanged(); + } else { + logTagsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder addLogTags( + com.aliyun.gateway.sls.util.Logs.LogTag.Builder builderForValue) { + if (logTagsBuilder_ == null) { + ensureLogTagsIsMutable(); + logTags_.add(builderForValue.build()); + onChanged(); + } else { + logTagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder addLogTags( + int index, com.aliyun.gateway.sls.util.Logs.LogTag.Builder builderForValue) { + if (logTagsBuilder_ == null) { + ensureLogTagsIsMutable(); + logTags_.add(index, builderForValue.build()); + onChanged(); + } else { + logTagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder addAllLogTags( + java.lang.Iterable values) { + if (logTagsBuilder_ == null) { + ensureLogTagsIsMutable(); + super.addAll(values, logTags_); + onChanged(); + } else { + logTagsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder clearLogTags() { + if (logTagsBuilder_ == null) { + logTags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + logTagsBuilder_.clear(); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public Builder removeLogTags(int index) { + if (logTagsBuilder_ == null) { + ensureLogTagsIsMutable(); + logTags_.remove(index); + onChanged(); + } else { + logTagsBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTag.Builder getLogTagsBuilder( + int index) { + return getLogTagsFieldBuilder().getBuilder(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder getLogTagsOrBuilder( + int index) { + if (logTagsBuilder_ == null) { + return logTags_.get(index); } else { + return logTagsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public java.util.List + getLogTagsOrBuilderList() { + if (logTagsBuilder_ != null) { + return logTagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logTags_); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTag.Builder addLogTagsBuilder() { + return getLogTagsFieldBuilder().addBuilder( + com.aliyun.gateway.sls.util.Logs.LogTag.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public com.aliyun.gateway.sls.util.Logs.LogTag.Builder addLogTagsBuilder( + int index) { + return getLogTagsFieldBuilder().addBuilder( + index, com.aliyun.gateway.sls.util.Logs.LogTag.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogTag LogTags = 6; + */ + public java.util.List + getLogTagsBuilderList() { + return getLogTagsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.LogTag, com.aliyun.gateway.sls.util.Logs.LogTag.Builder, com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder> + getLogTagsFieldBuilder() { + if (logTagsBuilder_ == null) { + logTagsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.LogTag, com.aliyun.gateway.sls.util.Logs.LogTag.Builder, com.aliyun.gateway.sls.util.Logs.LogTagOrBuilder>( + logTags_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + logTags_ = null; + } + return logTagsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:com.aliyun.gateway.sls.util.LogGroup) + } + + static { + defaultInstance = new LogGroup(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:com.aliyun.gateway.sls.util.LogGroup) + } + + public interface LogGroupListOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + java.util.List + getLogGroupListList(); + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + com.aliyun.gateway.sls.util.Logs.LogGroup getLogGroupList(int index); + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + int getLogGroupListCount(); + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + java.util.List + getLogGroupListOrBuilderList(); + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder getLogGroupListOrBuilder( + int index); + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.LogGroupList} + */ + public static final class LogGroupList extends + com.google.protobuf.GeneratedMessage + implements LogGroupListOrBuilder { + // Use LogGroupList.newBuilder() to construct. + private LogGroupList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private LogGroupList(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final LogGroupList defaultInstance; + public static LogGroupList getDefaultInstance() { + return defaultInstance; + } + + public LogGroupList getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogGroupList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logGroupList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + logGroupList_.add(input.readMessage(com.aliyun.gateway.sls.util.Logs.LogGroup.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logGroupList_ = java.util.Collections.unmodifiableList(logGroupList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroupList_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroupList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.LogGroupList.class, com.aliyun.gateway.sls.util.Logs.LogGroupList.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public LogGroupList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogGroupList(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + // repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + public static final int LOGGROUPLIST_FIELD_NUMBER = 1; + private java.util.List logGroupList_; + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public java.util.List getLogGroupListList() { + return logGroupList_; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public java.util.List + getLogGroupListOrBuilderList() { + return logGroupList_; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public int getLogGroupListCount() { + return logGroupList_.size(); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroup getLogGroupList(int index) { + return logGroupList_.get(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder getLogGroupListOrBuilder( + int index) { + return logGroupList_.get(index); + } + + private void initFields() { + logGroupList_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + for (int i = 0; i < getLogGroupListCount(); i++) { + if (!getLogGroupList(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < logGroupList_.size(); i++) { + output.writeMessage(1, logGroupList_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < logGroupList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, logGroupList_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.aliyun.gateway.sls.util.Logs.LogGroupList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.aliyun.gateway.sls.util.Logs.LogGroupList prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.aliyun.gateway.sls.util.LogGroupList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.aliyun.gateway.sls.util.Logs.LogGroupListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroupList_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroupList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.aliyun.gateway.sls.util.Logs.LogGroupList.class, com.aliyun.gateway.sls.util.Logs.LogGroupList.Builder.class); + } + + // Construct using com.aliyun.gateway.sls.util.Logs.LogGroupList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getLogGroupListFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (logGroupListBuilder_ == null) { + logGroupList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + logGroupListBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.aliyun.gateway.sls.util.Logs.internal_static_com_aliyun_openservices_log_common_LogGroupList_descriptor; + } + + public com.aliyun.gateway.sls.util.Logs.LogGroupList getDefaultInstanceForType() { + return com.aliyun.gateway.sls.util.Logs.LogGroupList.getDefaultInstance(); + } + + public com.aliyun.gateway.sls.util.Logs.LogGroupList build() { + com.aliyun.gateway.sls.util.Logs.LogGroupList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.aliyun.gateway.sls.util.Logs.LogGroupList buildPartial() { + com.aliyun.gateway.sls.util.Logs.LogGroupList result = new com.aliyun.gateway.sls.util.Logs.LogGroupList(this); + int from_bitField0_ = bitField0_; + if (logGroupListBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + logGroupList_ = java.util.Collections.unmodifiableList(logGroupList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.logGroupList_ = logGroupList_; + } else { + result.logGroupList_ = logGroupListBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.aliyun.gateway.sls.util.Logs.LogGroupList) { + return mergeFrom((com.aliyun.gateway.sls.util.Logs.LogGroupList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.aliyun.gateway.sls.util.Logs.LogGroupList other) { + if (other == com.aliyun.gateway.sls.util.Logs.LogGroupList.getDefaultInstance()) return this; + if (logGroupListBuilder_ == null) { + if (!other.logGroupList_.isEmpty()) { + if (logGroupList_.isEmpty()) { + logGroupList_ = other.logGroupList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLogGroupListIsMutable(); + logGroupList_.addAll(other.logGroupList_); + } + onChanged(); + } + } else { + if (!other.logGroupList_.isEmpty()) { + if (logGroupListBuilder_.isEmpty()) { + logGroupListBuilder_.dispose(); + logGroupListBuilder_ = null; + logGroupList_ = other.logGroupList_; + bitField0_ = (bitField0_ & ~0x00000001); + logGroupListBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLogGroupListFieldBuilder() : null; + } else { + logGroupListBuilder_.addAllMessages(other.logGroupList_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getLogGroupListCount(); i++) { + if (!getLogGroupList(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.aliyun.gateway.sls.util.Logs.LogGroupList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.aliyun.gateway.sls.util.Logs.LogGroupList) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + private java.util.List logGroupList_ = + java.util.Collections.emptyList(); + private void ensureLogGroupListIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + logGroupList_ = new java.util.ArrayList(logGroupList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.LogGroup, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder, com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder> logGroupListBuilder_; + + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public java.util.List getLogGroupListList() { + if (logGroupListBuilder_ == null) { + return java.util.Collections.unmodifiableList(logGroupList_); + } else { + return logGroupListBuilder_.getMessageList(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public int getLogGroupListCount() { + if (logGroupListBuilder_ == null) { + return logGroupList_.size(); + } else { + return logGroupListBuilder_.getCount(); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroup getLogGroupList(int index) { + if (logGroupListBuilder_ == null) { + return logGroupList_.get(index); + } else { + return logGroupListBuilder_.getMessage(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder setLogGroupList( + int index, com.aliyun.gateway.sls.util.Logs.LogGroup value) { + if (logGroupListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogGroupListIsMutable(); + logGroupList_.set(index, value); + onChanged(); + } else { + logGroupListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder setLogGroupList( + int index, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder builderForValue) { + if (logGroupListBuilder_ == null) { + ensureLogGroupListIsMutable(); + logGroupList_.set(index, builderForValue.build()); + onChanged(); + } else { + logGroupListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder addLogGroupList(com.aliyun.gateway.sls.util.Logs.LogGroup value) { + if (logGroupListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogGroupListIsMutable(); + logGroupList_.add(value); + onChanged(); + } else { + logGroupListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder addLogGroupList( + int index, com.aliyun.gateway.sls.util.Logs.LogGroup value) { + if (logGroupListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogGroupListIsMutable(); + logGroupList_.add(index, value); + onChanged(); + } else { + logGroupListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder addLogGroupList( + com.aliyun.gateway.sls.util.Logs.LogGroup.Builder builderForValue) { + if (logGroupListBuilder_ == null) { + ensureLogGroupListIsMutable(); + logGroupList_.add(builderForValue.build()); + onChanged(); + } else { + logGroupListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder addLogGroupList( + int index, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder builderForValue) { + if (logGroupListBuilder_ == null) { + ensureLogGroupListIsMutable(); + logGroupList_.add(index, builderForValue.build()); + onChanged(); + } else { + logGroupListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder addAllLogGroupList( + java.lang.Iterable values) { + if (logGroupListBuilder_ == null) { + ensureLogGroupListIsMutable(); + super.addAll(values, logGroupList_); + onChanged(); + } else { + logGroupListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder clearLogGroupList() { + if (logGroupListBuilder_ == null) { + logGroupList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + logGroupListBuilder_.clear(); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public Builder removeLogGroupList(int index) { + if (logGroupListBuilder_ == null) { + ensureLogGroupListIsMutable(); + logGroupList_.remove(index); + onChanged(); + } else { + logGroupListBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroup.Builder getLogGroupListBuilder( + int index) { + return getLogGroupListFieldBuilder().getBuilder(index); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder getLogGroupListOrBuilder( + int index) { + if (logGroupListBuilder_ == null) { + return logGroupList_.get(index); } else { + return logGroupListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public java.util.List + getLogGroupListOrBuilderList() { + if (logGroupListBuilder_ != null) { + return logGroupListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logGroupList_); + } + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroup.Builder addLogGroupListBuilder() { + return getLogGroupListFieldBuilder().addBuilder( + com.aliyun.gateway.sls.util.Logs.LogGroup.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public com.aliyun.gateway.sls.util.Logs.LogGroup.Builder addLogGroupListBuilder( + int index) { + return getLogGroupListFieldBuilder().addBuilder( + index, com.aliyun.gateway.sls.util.Logs.LogGroup.getDefaultInstance()); + } + /** + * repeated .com.aliyun.gateway.sls.util.LogGroup logGroupList = 1; + */ + public java.util.List + getLogGroupListBuilderList() { + return getLogGroupListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.LogGroup, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder, com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder> + getLogGroupListFieldBuilder() { + if (logGroupListBuilder_ == null) { + logGroupListBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.aliyun.gateway.sls.util.Logs.LogGroup, com.aliyun.gateway.sls.util.Logs.LogGroup.Builder, com.aliyun.gateway.sls.util.Logs.LogGroupOrBuilder>( + logGroupList_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + logGroupList_ = null; + } + return logGroupListBuilder_; + } + + // @@protoc_insertion_point(builder_scope:com.aliyun.gateway.sls.util.LogGroupList) + } + + static { + defaultInstance = new LogGroupList(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:com.aliyun.gateway.sls.util.LogGroupList) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_com_aliyun_openservices_log_common_Log_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_com_aliyun_openservices_log_common_Log_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_com_aliyun_openservices_log_common_Log_Content_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_com_aliyun_openservices_log_common_Log_Content_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_com_aliyun_openservices_log_common_LogTag_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_com_aliyun_openservices_log_common_LogTag_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_com_aliyun_openservices_log_common_LogGroup_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_com_aliyun_openservices_log_common_LogGroup_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_com_aliyun_openservices_log_common_LogGroupList_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_com_aliyun_openservices_log_common_LogGroupList_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\nLogs.proto\022\"com.aliyun.openservices.lo" + + "g.common\"\216\001\n\003Log\022\014\n\004Time\030\001 \002(\r\022A\n\010Conten" + + "ts\030\002 \003(\0132/.com.aliyun.openservices.log.c" + + "ommon.Log.Content\022\017\n\007Time_ns\030\004 \001(\007\032%\n\007Co" + + "ntent\022\013\n\003Key\030\001 \002(\t\022\r\n\005Value\030\002 \002(\t\"$\n\006Log" + + "Tag\022\013\n\003Key\030\001 \002(\t\022\r\n\005Value\030\002 \002(\t\"\304\001\n\010LogG" + + "roup\0225\n\004Logs\030\001 \003(\0132\'.com.aliyun.openserv" + + "ices.log.common.Log\022\020\n\010Category\030\002 \001(\t\022\r\n" + + "\005Topic\030\003 \001(\t\022\016\n\006Source\030\004 \001(\t\022\023\n\013MachineU" + + "UID\030\005 \001(\t\022;\n\007LogTags\030\006 \003(\0132*.com.aliyun.", + "openservices.log.common.LogTag\"R\n\014LogGro" + + "upList\022B\n\014logGroupList\030\001 \003(\0132,.com.aliyu" + + "n.openservices.log.common.LogGroup" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + internal_static_com_aliyun_openservices_log_common_Log_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_aliyun_openservices_log_common_Log_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_com_aliyun_openservices_log_common_Log_descriptor, + new java.lang.String[] { "Time", "Contents", "TimeNs", }); + internal_static_com_aliyun_openservices_log_common_Log_Content_descriptor = + internal_static_com_aliyun_openservices_log_common_Log_descriptor.getNestedTypes().get(0); + internal_static_com_aliyun_openservices_log_common_Log_Content_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_com_aliyun_openservices_log_common_Log_Content_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_com_aliyun_openservices_log_common_LogTag_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_com_aliyun_openservices_log_common_LogTag_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_com_aliyun_openservices_log_common_LogTag_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_com_aliyun_openservices_log_common_LogGroup_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_com_aliyun_openservices_log_common_LogGroup_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_com_aliyun_openservices_log_common_LogGroup_descriptor, + new java.lang.String[] { "Logs", "Category", "Topic", "Source", "MachineUUID", "LogTags", }); + internal_static_com_aliyun_openservices_log_common_LogGroupList_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_com_aliyun_openservices_log_common_LogGroupList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_com_aliyun_openservices_log_common_LogGroupList_descriptor, + new java.lang.String[] { "LogGroupList", }); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/alibabacloud-gateway-sls/util/main.tea b/alibabacloud-gateway-sls/util/main.tea index f12c3f20..561c3ca1 100644 --- a/alibabacloud-gateway-sls/util/main.tea +++ b/alibabacloud-gateway-sls/util/main.tea @@ -4,4 +4,10 @@ * @param stream the readable stream * @return the parsed result */ -static async function readAndUncompressBlock(stream: readable, compressType: string, bodyRawSize: string): readable \ No newline at end of file +static async function readAndUncompressBlock(stream: readable, compressType: string, bodyRawSize: string): readable + +static async function readAndCompressBlock(stream: bytes, compressType: string): bytes + +static async function serializeLogGroupToPB(logGroup: any): bytes + +static async function getBytesLength(stream: bytes): string \ No newline at end of file