Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.digitalasset.daml_lf_1_6.DamlLf Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: com/digitalasset/daml_lf_1_6/daml_lf.proto
package com.digitalasset.daml_lf_1_6;
public final class DamlLf {
private DamlLf() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
/**
* Protobuf enum {@code daml_lf_1_6.HashFunction}
*/
public enum HashFunction
implements com.google.protobuf.ProtocolMessageEnum {
/**
* SHA256 = 0;
*/
SHA256(0),
UNRECOGNIZED(-1),
;
/**
* SHA256 = 0;
*/
public static final int SHA256_VALUE = 0;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static HashFunction valueOf(int value) {
return forNumber(value);
}
public static HashFunction forNumber(int value) {
switch (value) {
case 0: return SHA256;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
HashFunction> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public HashFunction findValueByNumber(int number) {
return HashFunction.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.digitalasset.daml_lf_1_6.DamlLf.getDescriptor().getEnumTypes().get(0);
}
private static final HashFunction[] VALUES = values();
public static HashFunction valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private HashFunction(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:daml_lf_1_6.HashFunction)
}
public interface ArchivePayloadOrBuilder extends
// @@protoc_insertion_point(interface_extends:daml_lf_1_6.ArchivePayload)
com.google.protobuf.MessageOrBuilder {
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
java.lang.String getMinor();
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
com.google.protobuf.ByteString
getMinorBytes();
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
boolean hasDamlLf0();
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
com.digitalasset.daml_lf_1_6.DamlLf0.Package getDamlLf0();
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
com.digitalasset.daml_lf_1_6.DamlLf0.PackageOrBuilder getDamlLf0OrBuilder();
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
boolean hasDamlLf1();
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
com.digitalasset.daml_lf_1_6.DamlLf1.Package getDamlLf1();
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
com.digitalasset.daml_lf_1_6.DamlLf1.PackageOrBuilder getDamlLf1OrBuilder();
public com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.SumCase getSumCase();
}
/**
* Protobuf type {@code daml_lf_1_6.ArchivePayload}
*/
public static final class ArchivePayload extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:daml_lf_1_6.ArchivePayload)
ArchivePayloadOrBuilder {
private static final long serialVersionUID = 0L;
// Use ArchivePayload.newBuilder() to construct.
private ArchivePayload(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ArchivePayload() {
minor_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ArchivePayload();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ArchivePayload(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
com.digitalasset.daml_lf_1_6.DamlLf0.Package.Builder subBuilder = null;
if (sumCase_ == 1) {
subBuilder = ((com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_).toBuilder();
}
sum_ =
input.readMessage(com.digitalasset.daml_lf_1_6.DamlLf0.Package.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_);
sum_ = subBuilder.buildPartial();
}
sumCase_ = 1;
break;
}
case 18: {
com.digitalasset.daml_lf_1_6.DamlLf1.Package.Builder subBuilder = null;
if (sumCase_ == 2) {
subBuilder = ((com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_).toBuilder();
}
sum_ =
input.readMessage(com.digitalasset.daml_lf_1_6.DamlLf1.Package.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_);
sum_ = subBuilder.buildPartial();
}
sumCase_ = 2;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
minor_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_ArchivePayload_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_ArchivePayload_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.class, com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.Builder.class);
}
private int sumCase_ = 0;
private java.lang.Object sum_;
public enum SumCase
implements com.google.protobuf.Internal.EnumLite {
DAML_LF_0(1),
DAML_LF_1(2),
SUM_NOT_SET(0);
private final int value;
private SumCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static SumCase valueOf(int value) {
return forNumber(value);
}
public static SumCase forNumber(int value) {
switch (value) {
case 1: return DAML_LF_0;
case 2: return DAML_LF_1;
case 0: return SUM_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public SumCase
getSumCase() {
return SumCase.forNumber(
sumCase_);
}
public static final int MINOR_FIELD_NUMBER = 3;
private volatile java.lang.Object minor_;
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public java.lang.String getMinor() {
java.lang.Object ref = minor_;
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();
minor_ = s;
return s;
}
}
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public com.google.protobuf.ByteString
getMinorBytes() {
java.lang.Object ref = minor_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
minor_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DAML_LF_0_FIELD_NUMBER = 1;
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public boolean hasDamlLf0() {
return sumCase_ == 1;
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf0.Package getDamlLf0() {
if (sumCase_ == 1) {
return (com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance();
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf0.PackageOrBuilder getDamlLf0OrBuilder() {
if (sumCase_ == 1) {
return (com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance();
}
public static final int DAML_LF_1_FIELD_NUMBER = 2;
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public boolean hasDamlLf1() {
return sumCase_ == 2;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf1.Package getDamlLf1() {
if (sumCase_ == 2) {
return (com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance();
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf1.PackageOrBuilder getDamlLf1OrBuilder() {
if (sumCase_ == 2) {
return (com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance();
}
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 (sumCase_ == 1) {
output.writeMessage(1, (com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_);
}
if (sumCase_ == 2) {
output.writeMessage(2, (com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_);
}
if (!getMinorBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, minor_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (sumCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, (com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_);
}
if (sumCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_);
}
if (!getMinorBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, minor_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload)) {
return super.equals(obj);
}
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload other = (com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload) obj;
if (!getMinor()
.equals(other.getMinor())) return false;
if (!getSumCase().equals(other.getSumCase())) return false;
switch (sumCase_) {
case 1:
if (!getDamlLf0()
.equals(other.getDamlLf0())) return false;
break;
case 2:
if (!getDamlLf1()
.equals(other.getDamlLf1())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + MINOR_FIELD_NUMBER;
hash = (53 * hash) + getMinor().hashCode();
switch (sumCase_) {
case 1:
hash = (37 * hash) + DAML_LF_0_FIELD_NUMBER;
hash = (53 * hash) + getDamlLf0().hashCode();
break;
case 2:
hash = (37 * hash) + DAML_LF_1_FIELD_NUMBER;
hash = (53 * hash) + getDamlLf1().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload 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 com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload 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 com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload 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(com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload 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;
}
/**
* Protobuf type {@code daml_lf_1_6.ArchivePayload}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:daml_lf_1_6.ArchivePayload)
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayloadOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_ArchivePayload_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_ArchivePayload_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.class, com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.Builder.class);
}
// Construct using com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
minor_ = "";
sumCase_ = 0;
sum_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_ArchivePayload_descriptor;
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload getDefaultInstanceForType() {
return com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.getDefaultInstance();
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload build() {
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload buildPartial() {
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload result = new com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload(this);
result.minor_ = minor_;
if (sumCase_ == 1) {
if (damlLf0Builder_ == null) {
result.sum_ = sum_;
} else {
result.sum_ = damlLf0Builder_.build();
}
}
if (sumCase_ == 2) {
if (damlLf1Builder_ == null) {
result.sum_ = sum_;
} else {
result.sum_ = damlLf1Builder_.build();
}
}
result.sumCase_ = sumCase_;
onBuilt();
return result;
}
@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 com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload) {
return mergeFrom((com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload other) {
if (other == com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload.getDefaultInstance()) return this;
if (!other.getMinor().isEmpty()) {
minor_ = other.minor_;
onChanged();
}
switch (other.getSumCase()) {
case DAML_LF_0: {
mergeDamlLf0(other.getDamlLf0());
break;
}
case DAML_LF_1: {
mergeDamlLf1(other.getDamlLf1());
break;
}
case SUM_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int sumCase_ = 0;
private java.lang.Object sum_;
public SumCase
getSumCase() {
return SumCase.forNumber(
sumCase_);
}
public Builder clearSum() {
sumCase_ = 0;
sum_ = null;
onChanged();
return this;
}
private java.lang.Object minor_ = "";
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public java.lang.String getMinor() {
java.lang.Object ref = minor_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
minor_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public com.google.protobuf.ByteString
getMinorBytes() {
java.lang.Object ref = minor_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
minor_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public Builder setMinor(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
minor_ = value;
onChanged();
return this;
}
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public Builder clearMinor() {
minor_ = getDefaultInstance().getMinor();
onChanged();
return this;
}
/**
*
* this is number 3 for historical reasons -- we had
* DAML-LF v0 and v1 before we had minor versions.
*
*
* string minor = 3[json_name = "minor"];
*/
public Builder setMinorBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
minor_ = value;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.digitalasset.daml_lf_1_6.DamlLf0.Package, com.digitalasset.daml_lf_1_6.DamlLf0.Package.Builder, com.digitalasset.daml_lf_1_6.DamlLf0.PackageOrBuilder> damlLf0Builder_;
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public boolean hasDamlLf0() {
return sumCase_ == 1;
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf0.Package getDamlLf0() {
if (damlLf0Builder_ == null) {
if (sumCase_ == 1) {
return (com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance();
} else {
if (sumCase_ == 1) {
return damlLf0Builder_.getMessage();
}
return com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance();
}
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public Builder setDamlLf0(com.digitalasset.daml_lf_1_6.DamlLf0.Package value) {
if (damlLf0Builder_ == null) {
if (value == null) {
throw new NullPointerException();
}
sum_ = value;
onChanged();
} else {
damlLf0Builder_.setMessage(value);
}
sumCase_ = 1;
return this;
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public Builder setDamlLf0(
com.digitalasset.daml_lf_1_6.DamlLf0.Package.Builder builderForValue) {
if (damlLf0Builder_ == null) {
sum_ = builderForValue.build();
onChanged();
} else {
damlLf0Builder_.setMessage(builderForValue.build());
}
sumCase_ = 1;
return this;
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public Builder mergeDamlLf0(com.digitalasset.daml_lf_1_6.DamlLf0.Package value) {
if (damlLf0Builder_ == null) {
if (sumCase_ == 1 &&
sum_ != com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance()) {
sum_ = com.digitalasset.daml_lf_1_6.DamlLf0.Package.newBuilder((com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_)
.mergeFrom(value).buildPartial();
} else {
sum_ = value;
}
onChanged();
} else {
if (sumCase_ == 1) {
damlLf0Builder_.mergeFrom(value);
}
damlLf0Builder_.setMessage(value);
}
sumCase_ = 1;
return this;
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public Builder clearDamlLf0() {
if (damlLf0Builder_ == null) {
if (sumCase_ == 1) {
sumCase_ = 0;
sum_ = null;
onChanged();
}
} else {
if (sumCase_ == 1) {
sumCase_ = 0;
sum_ = null;
}
damlLf0Builder_.clear();
}
return this;
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf0.Package.Builder getDamlLf0Builder() {
return getDamlLf0FieldBuilder().getBuilder();
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf0.PackageOrBuilder getDamlLf0OrBuilder() {
if ((sumCase_ == 1) && (damlLf0Builder_ != null)) {
return damlLf0Builder_.getMessageOrBuilder();
} else {
if (sumCase_ == 1) {
return (com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance();
}
}
/**
* .daml_lf_0.Package daml_lf_0 = 1[json_name = "damlLf0"];
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.digitalasset.daml_lf_1_6.DamlLf0.Package, com.digitalasset.daml_lf_1_6.DamlLf0.Package.Builder, com.digitalasset.daml_lf_1_6.DamlLf0.PackageOrBuilder>
getDamlLf0FieldBuilder() {
if (damlLf0Builder_ == null) {
if (!(sumCase_ == 1)) {
sum_ = com.digitalasset.daml_lf_1_6.DamlLf0.Package.getDefaultInstance();
}
damlLf0Builder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.digitalasset.daml_lf_1_6.DamlLf0.Package, com.digitalasset.daml_lf_1_6.DamlLf0.Package.Builder, com.digitalasset.daml_lf_1_6.DamlLf0.PackageOrBuilder>(
(com.digitalasset.daml_lf_1_6.DamlLf0.Package) sum_,
getParentForChildren(),
isClean());
sum_ = null;
}
sumCase_ = 1;
onChanged();;
return damlLf0Builder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.digitalasset.daml_lf_1_6.DamlLf1.Package, com.digitalasset.daml_lf_1_6.DamlLf1.Package.Builder, com.digitalasset.daml_lf_1_6.DamlLf1.PackageOrBuilder> damlLf1Builder_;
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public boolean hasDamlLf1() {
return sumCase_ == 2;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf1.Package getDamlLf1() {
if (damlLf1Builder_ == null) {
if (sumCase_ == 2) {
return (com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance();
} else {
if (sumCase_ == 2) {
return damlLf1Builder_.getMessage();
}
return com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance();
}
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public Builder setDamlLf1(com.digitalasset.daml_lf_1_6.DamlLf1.Package value) {
if (damlLf1Builder_ == null) {
if (value == null) {
throw new NullPointerException();
}
sum_ = value;
onChanged();
} else {
damlLf1Builder_.setMessage(value);
}
sumCase_ = 2;
return this;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public Builder setDamlLf1(
com.digitalasset.daml_lf_1_6.DamlLf1.Package.Builder builderForValue) {
if (damlLf1Builder_ == null) {
sum_ = builderForValue.build();
onChanged();
} else {
damlLf1Builder_.setMessage(builderForValue.build());
}
sumCase_ = 2;
return this;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public Builder mergeDamlLf1(com.digitalasset.daml_lf_1_6.DamlLf1.Package value) {
if (damlLf1Builder_ == null) {
if (sumCase_ == 2 &&
sum_ != com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance()) {
sum_ = com.digitalasset.daml_lf_1_6.DamlLf1.Package.newBuilder((com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_)
.mergeFrom(value).buildPartial();
} else {
sum_ = value;
}
onChanged();
} else {
if (sumCase_ == 2) {
damlLf1Builder_.mergeFrom(value);
}
damlLf1Builder_.setMessage(value);
}
sumCase_ = 2;
return this;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public Builder clearDamlLf1() {
if (damlLf1Builder_ == null) {
if (sumCase_ == 2) {
sumCase_ = 0;
sum_ = null;
onChanged();
}
} else {
if (sumCase_ == 2) {
sumCase_ = 0;
sum_ = null;
}
damlLf1Builder_.clear();
}
return this;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf1.Package.Builder getDamlLf1Builder() {
return getDamlLf1FieldBuilder().getBuilder();
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf1.PackageOrBuilder getDamlLf1OrBuilder() {
if ((sumCase_ == 2) && (damlLf1Builder_ != null)) {
return damlLf1Builder_.getMessageOrBuilder();
} else {
if (sumCase_ == 2) {
return (com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_;
}
return com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance();
}
}
/**
* .daml_lf_1.Package daml_lf_1 = 2[json_name = "damlLf1"];
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.digitalasset.daml_lf_1_6.DamlLf1.Package, com.digitalasset.daml_lf_1_6.DamlLf1.Package.Builder, com.digitalasset.daml_lf_1_6.DamlLf1.PackageOrBuilder>
getDamlLf1FieldBuilder() {
if (damlLf1Builder_ == null) {
if (!(sumCase_ == 2)) {
sum_ = com.digitalasset.daml_lf_1_6.DamlLf1.Package.getDefaultInstance();
}
damlLf1Builder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.digitalasset.daml_lf_1_6.DamlLf1.Package, com.digitalasset.daml_lf_1_6.DamlLf1.Package.Builder, com.digitalasset.daml_lf_1_6.DamlLf1.PackageOrBuilder>(
(com.digitalasset.daml_lf_1_6.DamlLf1.Package) sum_,
getParentForChildren(),
isClean());
sum_ = null;
}
sumCase_ = 2;
onChanged();;
return damlLf1Builder_;
}
@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:daml_lf_1_6.ArchivePayload)
}
// @@protoc_insertion_point(class_scope:daml_lf_1_6.ArchivePayload)
private static final com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload();
}
public static com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ArchivePayload parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ArchivePayload(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.ArchivePayload getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface ArchiveOrBuilder extends
// @@protoc_insertion_point(interface_extends:daml_lf_1_6.Archive)
com.google.protobuf.MessageOrBuilder {
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
int getHashFunctionValue();
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
com.digitalasset.daml_lf_1_6.DamlLf.HashFunction getHashFunction();
/**
*
* Must be an encoded ArchivePayload. We store it as `bytes` to
* simplify hashing and in future signing.
*
*
* bytes payload = 3[json_name = "payload"];
*/
com.google.protobuf.ByteString getPayload();
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
java.lang.String getHash();
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
com.google.protobuf.ByteString
getHashBytes();
}
/**
* Protobuf type {@code daml_lf_1_6.Archive}
*/
public static final class Archive extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:daml_lf_1_6.Archive)
ArchiveOrBuilder {
private static final long serialVersionUID = 0L;
// Use Archive.newBuilder() to construct.
private Archive(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Archive() {
hashFunction_ = 0;
payload_ = com.google.protobuf.ByteString.EMPTY;
hash_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Archive();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Archive(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
hashFunction_ = rawValue;
break;
}
case 26: {
payload_ = input.readBytes();
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
hash_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_Archive_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_Archive_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.digitalasset.daml_lf_1_6.DamlLf.Archive.class, com.digitalasset.daml_lf_1_6.DamlLf.Archive.Builder.class);
}
public static final int HASH_FUNCTION_FIELD_NUMBER = 1;
private int hashFunction_;
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public int getHashFunctionValue() {
return hashFunction_;
}
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf.HashFunction getHashFunction() {
@SuppressWarnings("deprecation")
com.digitalasset.daml_lf_1_6.DamlLf.HashFunction result = com.digitalasset.daml_lf_1_6.DamlLf.HashFunction.valueOf(hashFunction_);
return result == null ? com.digitalasset.daml_lf_1_6.DamlLf.HashFunction.UNRECOGNIZED : result;
}
public static final int PAYLOAD_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString payload_;
/**
*
* Must be an encoded ArchivePayload. We store it as `bytes` to
* simplify hashing and in future signing.
*
*
* bytes payload = 3[json_name = "payload"];
*/
public com.google.protobuf.ByteString getPayload() {
return payload_;
}
public static final int HASH_FIELD_NUMBER = 4;
private volatile java.lang.Object hash_;
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public java.lang.String getHash() {
java.lang.Object ref = hash_;
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();
hash_ = s;
return s;
}
}
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public com.google.protobuf.ByteString
getHashBytes() {
java.lang.Object ref = hash_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
hash_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 (hashFunction_ != com.digitalasset.daml_lf_1_6.DamlLf.HashFunction.SHA256.getNumber()) {
output.writeEnum(1, hashFunction_);
}
if (!payload_.isEmpty()) {
output.writeBytes(3, payload_);
}
if (!getHashBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hash_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (hashFunction_ != com.digitalasset.daml_lf_1_6.DamlLf.HashFunction.SHA256.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, hashFunction_);
}
if (!payload_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, payload_);
}
if (!getHashBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, hash_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.digitalasset.daml_lf_1_6.DamlLf.Archive)) {
return super.equals(obj);
}
com.digitalasset.daml_lf_1_6.DamlLf.Archive other = (com.digitalasset.daml_lf_1_6.DamlLf.Archive) obj;
if (hashFunction_ != other.hashFunction_) return false;
if (!getPayload()
.equals(other.getPayload())) return false;
if (!getHash()
.equals(other.getHash())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + HASH_FUNCTION_FIELD_NUMBER;
hash = (53 * hash) + hashFunction_;
hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
hash = (53 * hash) + getPayload().hashCode();
hash = (37 * hash) + HASH_FIELD_NUMBER;
hash = (53 * hash) + getHash().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive 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 com.digitalasset.daml_lf_1_6.DamlLf.Archive parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive 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 com.digitalasset.daml_lf_1_6.DamlLf.Archive parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive 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(com.digitalasset.daml_lf_1_6.DamlLf.Archive 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;
}
/**
* Protobuf type {@code daml_lf_1_6.Archive}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:daml_lf_1_6.Archive)
com.digitalasset.daml_lf_1_6.DamlLf.ArchiveOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_Archive_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_Archive_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.digitalasset.daml_lf_1_6.DamlLf.Archive.class, com.digitalasset.daml_lf_1_6.DamlLf.Archive.Builder.class);
}
// Construct using com.digitalasset.daml_lf_1_6.DamlLf.Archive.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
hashFunction_ = 0;
payload_ = com.google.protobuf.ByteString.EMPTY;
hash_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.digitalasset.daml_lf_1_6.DamlLf.internal_static_daml_lf_1_6_Archive_descriptor;
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.Archive getDefaultInstanceForType() {
return com.digitalasset.daml_lf_1_6.DamlLf.Archive.getDefaultInstance();
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.Archive build() {
com.digitalasset.daml_lf_1_6.DamlLf.Archive result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.Archive buildPartial() {
com.digitalasset.daml_lf_1_6.DamlLf.Archive result = new com.digitalasset.daml_lf_1_6.DamlLf.Archive(this);
result.hashFunction_ = hashFunction_;
result.payload_ = payload_;
result.hash_ = hash_;
onBuilt();
return result;
}
@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 com.digitalasset.daml_lf_1_6.DamlLf.Archive) {
return mergeFrom((com.digitalasset.daml_lf_1_6.DamlLf.Archive)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.digitalasset.daml_lf_1_6.DamlLf.Archive other) {
if (other == com.digitalasset.daml_lf_1_6.DamlLf.Archive.getDefaultInstance()) return this;
if (other.hashFunction_ != 0) {
setHashFunctionValue(other.getHashFunctionValue());
}
if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) {
setPayload(other.getPayload());
}
if (!other.getHash().isEmpty()) {
hash_ = other.hash_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.digitalasset.daml_lf_1_6.DamlLf.Archive parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.digitalasset.daml_lf_1_6.DamlLf.Archive) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int hashFunction_ = 0;
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public int getHashFunctionValue() {
return hashFunction_;
}
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public Builder setHashFunctionValue(int value) {
hashFunction_ = value;
onChanged();
return this;
}
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public com.digitalasset.daml_lf_1_6.DamlLf.HashFunction getHashFunction() {
@SuppressWarnings("deprecation")
com.digitalasset.daml_lf_1_6.DamlLf.HashFunction result = com.digitalasset.daml_lf_1_6.DamlLf.HashFunction.valueOf(hashFunction_);
return result == null ? com.digitalasset.daml_lf_1_6.DamlLf.HashFunction.UNRECOGNIZED : result;
}
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public Builder setHashFunction(com.digitalasset.daml_lf_1_6.DamlLf.HashFunction value) {
if (value == null) {
throw new NullPointerException();
}
hashFunction_ = value.getNumber();
onChanged();
return this;
}
/**
* .daml_lf_1_6.HashFunction hash_function = 1[json_name = "hashFunction"];
*/
public Builder clearHashFunction() {
hashFunction_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* Must be an encoded ArchivePayload. We store it as `bytes` to
* simplify hashing and in future signing.
*
*
* bytes payload = 3[json_name = "payload"];
*/
public com.google.protobuf.ByteString getPayload() {
return payload_;
}
/**
*
* Must be an encoded ArchivePayload. We store it as `bytes` to
* simplify hashing and in future signing.
*
*
* bytes payload = 3[json_name = "payload"];
*/
public Builder setPayload(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
payload_ = value;
onChanged();
return this;
}
/**
*
* Must be an encoded ArchivePayload. We store it as `bytes` to
* simplify hashing and in future signing.
*
*
* bytes payload = 3[json_name = "payload"];
*/
public Builder clearPayload() {
payload_ = getDefaultInstance().getPayload();
onChanged();
return this;
}
private java.lang.Object hash_ = "";
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public java.lang.String getHash() {
java.lang.Object ref = hash_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
hash_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public com.google.protobuf.ByteString
getHashBytes() {
java.lang.Object ref = hash_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
hash_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public Builder setHash(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
hash_ = value;
onChanged();
return this;
}
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public Builder clearHash() {
hash_ = getDefaultInstance().getHash();
onChanged();
return this;
}
/**
*
* The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
* according to the hash_function. We store it here for convenience, code
* reading the Archive should verify that the hash is valid.
* Note that the hash is computed directly on the blob and not
* on the decoded structure. This means that servers implementing
* a DAML ledger need to store the blob as-is somewhere to be able
* to always offer proof that they have a DAML package matching
* the requested hash. We decided to go for this route rather than
* relying on a canonical encoding of the AST since such a scheme
* would be extremely hard (for example protobuf encoding is not
* canonical) to maintain and does not buy us much.
*
*
* string hash = 4[json_name = "hash"];
*/
public Builder setHashBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
hash_ = value;
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:daml_lf_1_6.Archive)
}
// @@protoc_insertion_point(class_scope:daml_lf_1_6.Archive)
private static final com.digitalasset.daml_lf_1_6.DamlLf.Archive DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.digitalasset.daml_lf_1_6.DamlLf.Archive();
}
public static com.digitalasset.daml_lf_1_6.DamlLf.Archive getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Archive parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Archive(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.digitalasset.daml_lf_1_6.DamlLf.Archive getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_daml_lf_1_6_ArchivePayload_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_daml_lf_1_6_ArchivePayload_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_daml_lf_1_6_Archive_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_daml_lf_1_6_Archive_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*com/digitalasset/daml_lf_1_6/daml_lf.p" +
"roto\022\013daml_lf_1_6\032,com/digitalasset/daml" +
"_lf_1_6/daml_lf_0.proto\032,com/digitalasse" +
"t/daml_lf_1_6/daml_lf_1.proto\"\231\001\n\016Archiv" +
"ePayload\022\024\n\005minor\030\003 \001(\tR\005minor\0220\n\tdaml_l" +
"f_0\030\001 \001(\0132\022.daml_lf_0.PackageH\000R\007damlLf0" +
"\0220\n\tdaml_lf_1\030\002 \001(\0132\022.daml_lf_1.PackageH" +
"\000R\007damlLf1B\005\n\003SumJ\006\010\217N\020\220N\"w\n\007Archive\022>\n\r" +
"hash_function\030\001 \001(\0162\031.daml_lf_1_6.HashFu" +
"nctionR\014hashFunction\022\030\n\007payload\030\003 \001(\014R\007p" +
"ayload\022\022\n\004hash\030\004 \001(\tR\004hash*\032\n\014HashFuncti" +
"on\022\n\n\006SHA256\020\000BD\n\034com.digitalasset.daml_" +
"lf_1_6\252\002#Com.DigitalAsset.Daml_Lf_1_6.Da" +
"mlLfb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.digitalasset.daml_lf_1_6.DamlLf0.getDescriptor(),
com.digitalasset.daml_lf_1_6.DamlLf1.getDescriptor(),
});
internal_static_daml_lf_1_6_ArchivePayload_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_daml_lf_1_6_ArchivePayload_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_daml_lf_1_6_ArchivePayload_descriptor,
new java.lang.String[] { "Minor", "DamlLf0", "DamlLf1", "Sum", });
internal_static_daml_lf_1_6_Archive_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_daml_lf_1_6_Archive_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_daml_lf_1_6_Archive_descriptor,
new java.lang.String[] { "HashFunction", "Payload", "Hash", });
com.digitalasset.daml_lf_1_6.DamlLf0.getDescriptor();
com.digitalasset.daml_lf_1_6.DamlLf1.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}