org.finos.tracdap.api.FileReadResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tracdap-api-services Show documentation
Show all versions of tracdap-api-services Show documentation
TRAC D.A.P. platform API, contains service API definitions for the TRAC platform services
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tracdap/api/data.proto
// Protobuf Java Version: 3.25.3
package org.finos.tracdap.api;
/**
*
**
* Response to a request to read a FILE, i.e. retrieve its content from the platform.
*
* @see TracDataApi.readFile
*
*
* Protobuf type {@code tracdap.api.FileReadResponse}
*/
public final class FileReadResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tracdap.api.FileReadResponse)
FileReadResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use FileReadResponse.newBuilder() to construct.
private FileReadResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private FileReadResponse() {
content_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new FileReadResponse();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.finos.tracdap.api.Data.internal_static_tracdap_api_FileReadResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.finos.tracdap.api.Data.internal_static_tracdap_api_FileReadResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.finos.tracdap.api.FileReadResponse.class, org.finos.tracdap.api.FileReadResponse.Builder.class);
}
private int bitField0_;
public static final int FILEDEFINITION_FIELD_NUMBER = 1;
private org.finos.tracdap.metadata.FileDefinition fileDefinition_;
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
* @return Whether the fileDefinition field is set.
*/
@java.lang.Override
public boolean hasFileDefinition() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
* @return The fileDefinition.
*/
@java.lang.Override
public org.finos.tracdap.metadata.FileDefinition getFileDefinition() {
return fileDefinition_ == null ? org.finos.tracdap.metadata.FileDefinition.getDefaultInstance() : fileDefinition_;
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
@java.lang.Override
public org.finos.tracdap.metadata.FileDefinitionOrBuilder getFileDefinitionOrBuilder() {
return fileDefinition_ == null ? org.finos.tracdap.metadata.FileDefinition.getDefaultInstance() : fileDefinition_;
}
public static final int CONTENT_FIELD_NUMBER = 1000;
private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY;
/**
*
**
* A chunk of the file content
*
* The file content will be sent as a stream of chunks (byte buffers), with one chunk in each message.
* Empty chunks may be included at any point in the response stream and should be ignored.
* In particular, TRAC guarantees that the chunk in the first message will always be an empty chunk.
*
*
* bytes content = 1000;
* @return The content.
*/
@java.lang.Override
public com.google.protobuf.ByteString getContent() {
return content_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getFileDefinition());
}
if (!content_.isEmpty()) {
output.writeBytes(1000, content_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getFileDefinition());
}
if (!content_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1000, content_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.finos.tracdap.api.FileReadResponse)) {
return super.equals(obj);
}
org.finos.tracdap.api.FileReadResponse other = (org.finos.tracdap.api.FileReadResponse) obj;
if (hasFileDefinition() != other.hasFileDefinition()) return false;
if (hasFileDefinition()) {
if (!getFileDefinition()
.equals(other.getFileDefinition())) return false;
}
if (!getContent()
.equals(other.getContent())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasFileDefinition()) {
hash = (37 * hash) + FILEDEFINITION_FIELD_NUMBER;
hash = (53 * hash) + getFileDefinition().hashCode();
}
hash = (37 * hash) + CONTENT_FIELD_NUMBER;
hash = (53 * hash) + getContent().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.finos.tracdap.api.FileReadResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.finos.tracdap.api.FileReadResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.finos.tracdap.api.FileReadResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.finos.tracdap.api.FileReadResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
**
* Response to a request to read a FILE, i.e. retrieve its content from the platform.
*
* @see TracDataApi.readFile
*
*
* Protobuf type {@code tracdap.api.FileReadResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:tracdap.api.FileReadResponse)
org.finos.tracdap.api.FileReadResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.finos.tracdap.api.Data.internal_static_tracdap_api_FileReadResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.finos.tracdap.api.Data.internal_static_tracdap_api_FileReadResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.finos.tracdap.api.FileReadResponse.class, org.finos.tracdap.api.FileReadResponse.Builder.class);
}
// Construct using org.finos.tracdap.api.FileReadResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getFileDefinitionFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
fileDefinition_ = null;
if (fileDefinitionBuilder_ != null) {
fileDefinitionBuilder_.dispose();
fileDefinitionBuilder_ = null;
}
content_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.finos.tracdap.api.Data.internal_static_tracdap_api_FileReadResponse_descriptor;
}
@java.lang.Override
public org.finos.tracdap.api.FileReadResponse getDefaultInstanceForType() {
return org.finos.tracdap.api.FileReadResponse.getDefaultInstance();
}
@java.lang.Override
public org.finos.tracdap.api.FileReadResponse build() {
org.finos.tracdap.api.FileReadResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.finos.tracdap.api.FileReadResponse buildPartial() {
org.finos.tracdap.api.FileReadResponse result = new org.finos.tracdap.api.FileReadResponse(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(org.finos.tracdap.api.FileReadResponse result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.fileDefinition_ = fileDefinitionBuilder_ == null
? fileDefinition_
: fileDefinitionBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.content_ = content_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.finos.tracdap.api.FileReadResponse) {
return mergeFrom((org.finos.tracdap.api.FileReadResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.finos.tracdap.api.FileReadResponse other) {
if (other == org.finos.tracdap.api.FileReadResponse.getDefaultInstance()) return this;
if (other.hasFileDefinition()) {
mergeFileDefinition(other.getFileDefinition());
}
if (other.getContent() != com.google.protobuf.ByteString.EMPTY) {
setContent(other.getContent());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getFileDefinitionFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 8002: {
content_ = input.readBytes();
bitField0_ |= 0x00000002;
break;
} // case 8002
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private org.finos.tracdap.metadata.FileDefinition fileDefinition_;
private com.google.protobuf.SingleFieldBuilderV3<
org.finos.tracdap.metadata.FileDefinition, org.finos.tracdap.metadata.FileDefinition.Builder, org.finos.tracdap.metadata.FileDefinitionOrBuilder> fileDefinitionBuilder_;
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
* @return Whether the fileDefinition field is set.
*/
public boolean hasFileDefinition() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
* @return The fileDefinition.
*/
public org.finos.tracdap.metadata.FileDefinition getFileDefinition() {
if (fileDefinitionBuilder_ == null) {
return fileDefinition_ == null ? org.finos.tracdap.metadata.FileDefinition.getDefaultInstance() : fileDefinition_;
} else {
return fileDefinitionBuilder_.getMessage();
}
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
public Builder setFileDefinition(org.finos.tracdap.metadata.FileDefinition value) {
if (fileDefinitionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
fileDefinition_ = value;
} else {
fileDefinitionBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
public Builder setFileDefinition(
org.finos.tracdap.metadata.FileDefinition.Builder builderForValue) {
if (fileDefinitionBuilder_ == null) {
fileDefinition_ = builderForValue.build();
} else {
fileDefinitionBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
public Builder mergeFileDefinition(org.finos.tracdap.metadata.FileDefinition value) {
if (fileDefinitionBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
fileDefinition_ != null &&
fileDefinition_ != org.finos.tracdap.metadata.FileDefinition.getDefaultInstance()) {
getFileDefinitionBuilder().mergeFrom(value);
} else {
fileDefinition_ = value;
}
} else {
fileDefinitionBuilder_.mergeFrom(value);
}
if (fileDefinition_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
public Builder clearFileDefinition() {
bitField0_ = (bitField0_ & ~0x00000001);
fileDefinition_ = null;
if (fileDefinitionBuilder_ != null) {
fileDefinitionBuilder_.dispose();
fileDefinitionBuilder_ = null;
}
onChanged();
return this;
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
public org.finos.tracdap.metadata.FileDefinition.Builder getFileDefinitionBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getFileDefinitionFieldBuilder().getBuilder();
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
public org.finos.tracdap.metadata.FileDefinitionOrBuilder getFileDefinitionOrBuilder() {
if (fileDefinitionBuilder_ != null) {
return fileDefinitionBuilder_.getMessageOrBuilder();
} else {
return fileDefinition_ == null ?
org.finos.tracdap.metadata.FileDefinition.getDefaultInstance() : fileDefinition_;
}
}
/**
*
**
* Definition of the FILE being read
*
*
* optional .tracdap.metadata.FileDefinition fileDefinition = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.finos.tracdap.metadata.FileDefinition, org.finos.tracdap.metadata.FileDefinition.Builder, org.finos.tracdap.metadata.FileDefinitionOrBuilder>
getFileDefinitionFieldBuilder() {
if (fileDefinitionBuilder_ == null) {
fileDefinitionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.finos.tracdap.metadata.FileDefinition, org.finos.tracdap.metadata.FileDefinition.Builder, org.finos.tracdap.metadata.FileDefinitionOrBuilder>(
getFileDefinition(),
getParentForChildren(),
isClean());
fileDefinition_ = null;
}
return fileDefinitionBuilder_;
}
private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY;
/**
*
**
* A chunk of the file content
*
* The file content will be sent as a stream of chunks (byte buffers), with one chunk in each message.
* Empty chunks may be included at any point in the response stream and should be ignored.
* In particular, TRAC guarantees that the chunk in the first message will always be an empty chunk.
*
*
* bytes content = 1000;
* @return The content.
*/
@java.lang.Override
public com.google.protobuf.ByteString getContent() {
return content_;
}
/**
*
**
* A chunk of the file content
*
* The file content will be sent as a stream of chunks (byte buffers), with one chunk in each message.
* Empty chunks may be included at any point in the response stream and should be ignored.
* In particular, TRAC guarantees that the chunk in the first message will always be an empty chunk.
*
*
* bytes content = 1000;
* @param value The content to set.
* @return This builder for chaining.
*/
public Builder setContent(com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
content_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
**
* A chunk of the file content
*
* The file content will be sent as a stream of chunks (byte buffers), with one chunk in each message.
* Empty chunks may be included at any point in the response stream and should be ignored.
* In particular, TRAC guarantees that the chunk in the first message will always be an empty chunk.
*
*
* bytes content = 1000;
* @return This builder for chaining.
*/
public Builder clearContent() {
bitField0_ = (bitField0_ & ~0x00000002);
content_ = getDefaultInstance().getContent();
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:tracdap.api.FileReadResponse)
}
// @@protoc_insertion_point(class_scope:tracdap.api.FileReadResponse)
private static final org.finos.tracdap.api.FileReadResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.finos.tracdap.api.FileReadResponse();
}
public static org.finos.tracdap.api.FileReadResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public FileReadResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.finos.tracdap.api.FileReadResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}