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.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: com/daml/daml_lf_dev/daml_lf.proto
package com.daml.daml_lf_dev;
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_dev.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;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static HashFunction valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static 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() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
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.daml.daml_lf_dev.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_dev.HashFunction)
}
public interface ArchivePayloadOrBuilder extends
// @@protoc_insertion_point(interface_extends:daml_lf_dev.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;
* @return The 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;
* @return The bytes for minor.
*/
com.google.protobuf.ByteString
getMinorBytes();
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return Whether the damlLf1 field is set.
*/
boolean hasDamlLf1();
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return The damlLf1.
*/
com.google.protobuf.ByteString getDamlLf1();
/**
* .daml_lf_2.Package daml_lf_2 = 4;
* @return Whether the damlLf2 field is set.
*/
boolean hasDamlLf2();
/**
* .daml_lf_2.Package daml_lf_2 = 4;
* @return The damlLf2.
*/
com.daml.daml_lf_dev.DamlLf2.Package getDamlLf2();
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
com.daml.daml_lf_dev.DamlLf2.PackageOrBuilder getDamlLf2OrBuilder();
com.daml.daml_lf_dev.DamlLf.ArchivePayload.SumCase getSumCase();
}
/**
* Protobuf type {@code daml_lf_dev.ArchivePayload}
*/
public static final class ArchivePayload extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:daml_lf_dev.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();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_ArchivePayload_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_ArchivePayload_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.daml.daml_lf_dev.DamlLf.ArchivePayload.class, com.daml.daml_lf_dev.DamlLf.ArchivePayload.Builder.class);
}
private int sumCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object sum_;
public enum SumCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
DAML_LF_1(2),
DAML_LF_2(4),
SUM_NOT_SET(0);
private final int value;
private SumCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static SumCase valueOf(int value) {
return forNumber(value);
}
public static SumCase forNumber(int value) {
switch (value) {
case 2: return DAML_LF_1;
case 4: return DAML_LF_2;
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;
@SuppressWarnings("serial")
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;
* @return The minor.
*/
@java.lang.Override
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;
* @return The bytes for minor.
*/
@java.lang.Override
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_1_FIELD_NUMBER = 2;
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return Whether the damlLf1 field is set.
*/
@java.lang.Override
public boolean hasDamlLf1() {
return sumCase_ == 2;
}
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return The damlLf1.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDamlLf1() {
if (sumCase_ == 2) {
return (com.google.protobuf.ByteString) sum_;
}
return com.google.protobuf.ByteString.EMPTY;
}
public static final int DAML_LF_2_FIELD_NUMBER = 4;
/**
* .daml_lf_2.Package daml_lf_2 = 4;
* @return Whether the damlLf2 field is set.
*/
@java.lang.Override
public boolean hasDamlLf2() {
return sumCase_ == 4;
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
* @return The damlLf2.
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf2.Package getDamlLf2() {
if (sumCase_ == 4) {
return (com.daml.daml_lf_dev.DamlLf2.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf2.Package.getDefaultInstance();
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf2.PackageOrBuilder getDamlLf2OrBuilder() {
if (sumCase_ == 4) {
return (com.daml.daml_lf_dev.DamlLf2.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf2.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_ == 2) {
output.writeBytes(
2, (com.google.protobuf.ByteString) sum_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minor_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, minor_);
}
if (sumCase_ == 4) {
output.writeMessage(4, (com.daml.daml_lf_dev.DamlLf2.Package) sum_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (sumCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(
2, (com.google.protobuf.ByteString) sum_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minor_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, minor_);
}
if (sumCase_ == 4) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, (com.daml.daml_lf_dev.DamlLf2.Package) sum_);
}
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 com.daml.daml_lf_dev.DamlLf.ArchivePayload)) {
return super.equals(obj);
}
com.daml.daml_lf_dev.DamlLf.ArchivePayload other = (com.daml.daml_lf_dev.DamlLf.ArchivePayload) obj;
if (!getMinor()
.equals(other.getMinor())) return false;
if (!getSumCase().equals(other.getSumCase())) return false;
switch (sumCase_) {
case 2:
if (!getDamlLf1()
.equals(other.getDamlLf1())) return false;
break;
case 4:
if (!getDamlLf2()
.equals(other.getDamlLf2())) return false;
break;
case 0:
default:
}
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();
hash = (37 * hash) + MINOR_FIELD_NUMBER;
hash = (53 * hash) + getMinor().hashCode();
switch (sumCase_) {
case 2:
hash = (37 * hash) + DAML_LF_1_FIELD_NUMBER;
hash = (53 * hash) + getDamlLf1().hashCode();
break;
case 4:
hash = (37 * hash) + DAML_LF_2_FIELD_NUMBER;
hash = (53 * hash) + getDamlLf2().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.daml.daml_lf_dev.DamlLf.ArchivePayload parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.ArchivePayload parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.ArchivePayload parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.daml.daml_lf_dev.DamlLf.ArchivePayload parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.daml.daml_lf_dev.DamlLf.ArchivePayload parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.ArchivePayload parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.ArchivePayload parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.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_dev.ArchivePayload}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:daml_lf_dev.ArchivePayload)
com.daml.daml_lf_dev.DamlLf.ArchivePayloadOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_ArchivePayload_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_ArchivePayload_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.daml.daml_lf_dev.DamlLf.ArchivePayload.class, com.daml.daml_lf_dev.DamlLf.ArchivePayload.Builder.class);
}
// Construct using com.daml.daml_lf_dev.DamlLf.ArchivePayload.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
minor_ = "";
if (damlLf2Builder_ != null) {
damlLf2Builder_.clear();
}
sumCase_ = 0;
sum_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_ArchivePayload_descriptor;
}
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.ArchivePayload getDefaultInstanceForType() {
return com.daml.daml_lf_dev.DamlLf.ArchivePayload.getDefaultInstance();
}
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.ArchivePayload build() {
com.daml.daml_lf_dev.DamlLf.ArchivePayload result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.ArchivePayload buildPartial() {
com.daml.daml_lf_dev.DamlLf.ArchivePayload result = new com.daml.daml_lf_dev.DamlLf.ArchivePayload(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.daml.daml_lf_dev.DamlLf.ArchivePayload result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.minor_ = minor_;
}
}
private void buildPartialOneofs(com.daml.daml_lf_dev.DamlLf.ArchivePayload result) {
result.sumCase_ = sumCase_;
result.sum_ = this.sum_;
if (sumCase_ == 4 &&
damlLf2Builder_ != null) {
result.sum_ = damlLf2Builder_.build();
}
}
@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.daml.daml_lf_dev.DamlLf.ArchivePayload) {
return mergeFrom((com.daml.daml_lf_dev.DamlLf.ArchivePayload)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.daml.daml_lf_dev.DamlLf.ArchivePayload other) {
if (other == com.daml.daml_lf_dev.DamlLf.ArchivePayload.getDefaultInstance()) return this;
if (!other.getMinor().isEmpty()) {
minor_ = other.minor_;
bitField0_ |= 0x00000001;
onChanged();
}
switch (other.getSumCase()) {
case DAML_LF_1: {
setDamlLf1(other.getDamlLf1());
break;
}
case DAML_LF_2: {
mergeDamlLf2(other.getDamlLf2());
break;
}
case SUM_NOT_SET: {
break;
}
}
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 18: {
sum_ = input.readBytes();
sumCase_ = 2;
break;
} // case 18
case 26: {
minor_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 26
case 34: {
input.readMessage(
getDamlLf2FieldBuilder().getBuilder(),
extensionRegistry);
sumCase_ = 4;
break;
} // case 34
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 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 int bitField0_;
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;
* @return The 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;
* @return The bytes for 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;
* @param value The minor to set.
* @return This builder for chaining.
*/
public Builder setMinor(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
minor_ = value;
bitField0_ |= 0x00000001;
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;
* @return This builder for chaining.
*/
public Builder clearMinor() {
minor_ = getDefaultInstance().getMinor();
bitField0_ = (bitField0_ & ~0x00000001);
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;
* @param value The bytes for minor to set.
* @return This builder for chaining.
*/
public Builder setMinorBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
minor_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return Whether the damlLf1 field is set.
*/
public boolean hasDamlLf1() {
return sumCase_ == 2;
}
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return The damlLf1.
*/
public com.google.protobuf.ByteString getDamlLf1() {
if (sumCase_ == 2) {
return (com.google.protobuf.ByteString) sum_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @param value The damlLf1 to set.
* @return This builder for chaining.
*/
public Builder setDamlLf1(com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
sumCase_ = 2;
sum_ = value;
onChanged();
return this;
}
/**
*
* we keep bytes to avoid static dependency
*
*
* bytes daml_lf_1 = 2;
* @return This builder for chaining.
*/
public Builder clearDamlLf1() {
if (sumCase_ == 2) {
sumCase_ = 0;
sum_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.daml.daml_lf_dev.DamlLf2.Package, com.daml.daml_lf_dev.DamlLf2.Package.Builder, com.daml.daml_lf_dev.DamlLf2.PackageOrBuilder> damlLf2Builder_;
/**
* .daml_lf_2.Package daml_lf_2 = 4;
* @return Whether the damlLf2 field is set.
*/
@java.lang.Override
public boolean hasDamlLf2() {
return sumCase_ == 4;
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
* @return The damlLf2.
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf2.Package getDamlLf2() {
if (damlLf2Builder_ == null) {
if (sumCase_ == 4) {
return (com.daml.daml_lf_dev.DamlLf2.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf2.Package.getDefaultInstance();
} else {
if (sumCase_ == 4) {
return damlLf2Builder_.getMessage();
}
return com.daml.daml_lf_dev.DamlLf2.Package.getDefaultInstance();
}
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
public Builder setDamlLf2(com.daml.daml_lf_dev.DamlLf2.Package value) {
if (damlLf2Builder_ == null) {
if (value == null) {
throw new NullPointerException();
}
sum_ = value;
onChanged();
} else {
damlLf2Builder_.setMessage(value);
}
sumCase_ = 4;
return this;
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
public Builder setDamlLf2(
com.daml.daml_lf_dev.DamlLf2.Package.Builder builderForValue) {
if (damlLf2Builder_ == null) {
sum_ = builderForValue.build();
onChanged();
} else {
damlLf2Builder_.setMessage(builderForValue.build());
}
sumCase_ = 4;
return this;
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
public Builder mergeDamlLf2(com.daml.daml_lf_dev.DamlLf2.Package value) {
if (damlLf2Builder_ == null) {
if (sumCase_ == 4 &&
sum_ != com.daml.daml_lf_dev.DamlLf2.Package.getDefaultInstance()) {
sum_ = com.daml.daml_lf_dev.DamlLf2.Package.newBuilder((com.daml.daml_lf_dev.DamlLf2.Package) sum_)
.mergeFrom(value).buildPartial();
} else {
sum_ = value;
}
onChanged();
} else {
if (sumCase_ == 4) {
damlLf2Builder_.mergeFrom(value);
} else {
damlLf2Builder_.setMessage(value);
}
}
sumCase_ = 4;
return this;
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
public Builder clearDamlLf2() {
if (damlLf2Builder_ == null) {
if (sumCase_ == 4) {
sumCase_ = 0;
sum_ = null;
onChanged();
}
} else {
if (sumCase_ == 4) {
sumCase_ = 0;
sum_ = null;
}
damlLf2Builder_.clear();
}
return this;
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
public com.daml.daml_lf_dev.DamlLf2.Package.Builder getDamlLf2Builder() {
return getDamlLf2FieldBuilder().getBuilder();
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf2.PackageOrBuilder getDamlLf2OrBuilder() {
if ((sumCase_ == 4) && (damlLf2Builder_ != null)) {
return damlLf2Builder_.getMessageOrBuilder();
} else {
if (sumCase_ == 4) {
return (com.daml.daml_lf_dev.DamlLf2.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf2.Package.getDefaultInstance();
}
}
/**
* .daml_lf_2.Package daml_lf_2 = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.daml.daml_lf_dev.DamlLf2.Package, com.daml.daml_lf_dev.DamlLf2.Package.Builder, com.daml.daml_lf_dev.DamlLf2.PackageOrBuilder>
getDamlLf2FieldBuilder() {
if (damlLf2Builder_ == null) {
if (!(sumCase_ == 4)) {
sum_ = com.daml.daml_lf_dev.DamlLf2.Package.getDefaultInstance();
}
damlLf2Builder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.daml.daml_lf_dev.DamlLf2.Package, com.daml.daml_lf_dev.DamlLf2.Package.Builder, com.daml.daml_lf_dev.DamlLf2.PackageOrBuilder>(
(com.daml.daml_lf_dev.DamlLf2.Package) sum_,
getParentForChildren(),
isClean());
sum_ = null;
}
sumCase_ = 4;
onChanged();
return damlLf2Builder_;
}
@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_dev.ArchivePayload)
}
// @@protoc_insertion_point(class_scope:daml_lf_dev.ArchivePayload)
private static final com.daml.daml_lf_dev.DamlLf.ArchivePayload DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.daml.daml_lf_dev.DamlLf.ArchivePayload();
}
public static com.daml.daml_lf_dev.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 {
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 com.daml.daml_lf_dev.DamlLf.ArchivePayload getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface ArchiveOrBuilder extends
// @@protoc_insertion_point(interface_extends:daml_lf_dev.Archive)
com.google.protobuf.MessageOrBuilder {
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return The enum numeric value on the wire for hashFunction.
*/
int getHashFunctionValue();
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return The hashFunction.
*/
com.daml.daml_lf_dev.DamlLf.HashFunction getHashFunction();
/**
*
* Must be an encoded ArchivePayload. We store it as `bytes` to
* simplify hashing and in future signing.
*
* 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.
*
* 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;
* @return The bytes for hash.
*/
com.google.protobuf.ByteString
getHashBytes();
}
/**
* Protobuf type {@code daml_lf_dev.Archive}
*/
public static final class Archive extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:daml_lf_dev.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();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_Archive_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_Archive_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.daml.daml_lf_dev.DamlLf.Archive.class, com.daml.daml_lf_dev.DamlLf.Archive.Builder.class);
}
public static final int HASH_FUNCTION_FIELD_NUMBER = 1;
private int hashFunction_ = 0;
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return The enum numeric value on the wire for hashFunction.
*/
@java.lang.Override public int getHashFunctionValue() {
return hashFunction_;
}
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return The hashFunction.
*/
@java.lang.Override public com.daml.daml_lf_dev.DamlLf.HashFunction getHashFunction() {
com.daml.daml_lf_dev.DamlLf.HashFunction result = com.daml.daml_lf_dev.DamlLf.HashFunction.forNumber(hashFunction_);
return result == null ? com.daml.daml_lf_dev.DamlLf.HashFunction.UNRECOGNIZED : result;
}
public static final int PAYLOAD_FIELD_NUMBER = 3;
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;
* @return The payload.
*/
@java.lang.Override
public com.google.protobuf.ByteString getPayload() {
return payload_;
}
public static final int HASH_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
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.
*
* 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;
* @return The bytes for hash.
*/
@java.lang.Override
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.daml.daml_lf_dev.DamlLf.HashFunction.SHA256.getNumber()) {
output.writeEnum(1, hashFunction_);
}
if (!payload_.isEmpty()) {
output.writeBytes(3, payload_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hash_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hash_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (hashFunction_ != com.daml.daml_lf_dev.DamlLf.HashFunction.SHA256.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, hashFunction_);
}
if (!payload_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, payload_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hash_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, hash_);
}
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 com.daml.daml_lf_dev.DamlLf.Archive)) {
return super.equals(obj);
}
com.daml.daml_lf_dev.DamlLf.Archive other = (com.daml.daml_lf_dev.DamlLf.Archive) obj;
if (hashFunction_ != other.hashFunction_) return false;
if (!getPayload()
.equals(other.getPayload())) return false;
if (!getHash()
.equals(other.getHash())) 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();
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) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.daml.daml_lf_dev.DamlLf.Archive parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.Archive parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.Archive parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.daml.daml_lf_dev.DamlLf.Archive parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.daml.daml_lf_dev.DamlLf.Archive parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.Archive parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.DamlLf.Archive parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.daml.daml_lf_dev.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.daml.daml_lf_dev.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_dev.Archive}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:daml_lf_dev.Archive)
com.daml.daml_lf_dev.DamlLf.ArchiveOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_Archive_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_Archive_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.daml.daml_lf_dev.DamlLf.Archive.class, com.daml.daml_lf_dev.DamlLf.Archive.Builder.class);
}
// Construct using com.daml.daml_lf_dev.DamlLf.Archive.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
hashFunction_ = 0;
payload_ = com.google.protobuf.ByteString.EMPTY;
hash_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.daml.daml_lf_dev.DamlLf.internal_static_daml_lf_dev_Archive_descriptor;
}
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.Archive getDefaultInstanceForType() {
return com.daml.daml_lf_dev.DamlLf.Archive.getDefaultInstance();
}
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.Archive build() {
com.daml.daml_lf_dev.DamlLf.Archive result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.Archive buildPartial() {
com.daml.daml_lf_dev.DamlLf.Archive result = new com.daml.daml_lf_dev.DamlLf.Archive(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.daml.daml_lf_dev.DamlLf.Archive result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.hashFunction_ = hashFunction_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.payload_ = payload_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.hash_ = hash_;
}
}
@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.daml.daml_lf_dev.DamlLf.Archive) {
return mergeFrom((com.daml.daml_lf_dev.DamlLf.Archive)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.daml.daml_lf_dev.DamlLf.Archive other) {
if (other == com.daml.daml_lf_dev.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_;
bitField0_ |= 0x00000004;
onChanged();
}
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 8: {
hashFunction_ = input.readEnum();
bitField0_ |= 0x00000001;
break;
} // case 8
case 26: {
payload_ = input.readBytes();
bitField0_ |= 0x00000002;
break;
} // case 26
case 34: {
hash_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 34
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 int hashFunction_ = 0;
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return The enum numeric value on the wire for hashFunction.
*/
@java.lang.Override public int getHashFunctionValue() {
return hashFunction_;
}
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @param value The enum numeric value on the wire for hashFunction to set.
* @return This builder for chaining.
*/
public Builder setHashFunctionValue(int value) {
hashFunction_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return The hashFunction.
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf.HashFunction getHashFunction() {
com.daml.daml_lf_dev.DamlLf.HashFunction result = com.daml.daml_lf_dev.DamlLf.HashFunction.forNumber(hashFunction_);
return result == null ? com.daml.daml_lf_dev.DamlLf.HashFunction.UNRECOGNIZED : result;
}
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @param value The hashFunction to set.
* @return This builder for chaining.
*/
public Builder setHashFunction(com.daml.daml_lf_dev.DamlLf.HashFunction value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
hashFunction_ = value.getNumber();
onChanged();
return this;
}
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return This builder for chaining.
*/
public Builder clearHashFunction() {
bitField0_ = (bitField0_ & ~0x00000001);
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.
*
* 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.
*
* 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;
* @return The bytes for 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;
* @param value The hash to set.
* @return This builder for chaining.
*/
public Builder setHash(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
hash_ = value;
bitField0_ |= 0x00000004;
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.
*
* 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;
* @param value The bytes for hash to set.
* @return This builder for chaining.
*/
public Builder setHashBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
hash_ = value;
bitField0_ |= 0x00000004;
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_dev.Archive)
}
// @@protoc_insertion_point(class_scope:daml_lf_dev.Archive)
private static final com.daml.daml_lf_dev.DamlLf.Archive DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.daml.daml_lf_dev.DamlLf.Archive();
}
public static com.daml.daml_lf_dev.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 {
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 com.daml.daml_lf_dev.DamlLf.Archive getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_daml_lf_dev_ArchivePayload_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_daml_lf_dev_ArchivePayload_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_daml_lf_dev_Archive_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_daml_lf_dev_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/daml/daml_lf_dev/daml_lf.proto\022\013da" +
"ml_lf_dev\032#com/daml/daml_lf_dev/daml_lf2" +
".proto\"r\n\016ArchivePayload\022\r\n\005minor\030\003 \001(\t\022" +
"\023\n\tdaml_lf_1\030\002 \001(\014H\000\022\'\n\tdaml_lf_2\030\004 \001(\0132" +
"\022.daml_lf_2.PackageH\000B\005\n\003SumJ\006\010\217N\020\220NJ\004\010\001" +
"\020\002\"Z\n\007Archive\0220\n\rhash_function\030\001 \001(\0162\031.d" +
"aml_lf_dev.HashFunction\022\017\n\007payload\030\003 \001(\014" +
"\022\014\n\004hash\030\004 \001(\t*\032\n\014HashFunction\022\n\n\006SHA256" +
"\020\000B4\n\024com.daml.daml_lf_dev\252\002\033Com.Daml.Da" +
"ml_Lf_Dev.DamlLfb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.daml.daml_lf_dev.DamlLf2.getDescriptor(),
});
internal_static_daml_lf_dev_ArchivePayload_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_daml_lf_dev_ArchivePayload_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_daml_lf_dev_ArchivePayload_descriptor,
new java.lang.String[] { "Minor", "DamlLf1", "DamlLf2", "Sum", });
internal_static_daml_lf_dev_Archive_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_daml_lf_dev_Archive_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_daml_lf_dev_Archive_descriptor,
new java.lang.String[] { "HashFunction", "Payload", "Hash", });
com.daml.daml_lf_dev.DamlLf2.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}