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();
/**
* .daml_lf_1.Package daml_lf_1 = 2;
* @return Whether the damlLf1 field is set.
*/
boolean hasDamlLf1();
/**
* .daml_lf_1.Package daml_lf_1 = 2;
* @return The damlLf1.
*/
com.daml.daml_lf_dev.DamlLf1.Package getDamlLf1();
/**
* .daml_lf_1.Package daml_lf_1 = 2;
*/
com.daml.daml_lf_dev.DamlLf1.PackageOrBuilder getDamlLf1OrBuilder();
public 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();
}
@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 18: {
com.daml.daml_lf_dev.DamlLf1.Package.Builder subBuilder = null;
if (sumCase_ == 2) {
subBuilder = ((com.daml.daml_lf_dev.DamlLf1.Package) sum_).toBuilder();
}
sum_ =
input.readMessage(com.daml.daml_lf_dev.DamlLf1.Package.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.daml.daml_lf_dev.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.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;
private java.lang.Object sum_;
public enum SumCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
DAML_LF_1(2),
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 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;
* @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;
/**
* .daml_lf_1.Package daml_lf_1 = 2;
* @return Whether the damlLf1 field is set.
*/
@java.lang.Override
public boolean hasDamlLf1() {
return sumCase_ == 2;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2;
* @return The damlLf1.
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf1.Package getDamlLf1() {
if (sumCase_ == 2) {
return (com.daml.daml_lf_dev.DamlLf1.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf1.Package.getDefaultInstance();
}
/**
* .daml_lf_1.Package daml_lf_1 = 2;
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf1.PackageOrBuilder getDamlLf1OrBuilder() {
if (sumCase_ == 2) {
return (com.daml.daml_lf_dev.DamlLf1.Package) sum_;
}
return com.daml.daml_lf_dev.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_ == 2) {
output.writeMessage(2, (com.daml.daml_lf_dev.DamlLf1.Package) sum_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minor_)) {
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_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.daml.daml_lf_dev.DamlLf1.Package) sum_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minor_)) {
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.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 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 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.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() {
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.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);
result.minor_ = minor_;
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.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_;
onChanged();
}
switch (other.getSumCase()) {
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.daml.daml_lf_dev.DamlLf.ArchivePayload parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.daml.daml_lf_dev.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;
* @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;
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();
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;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.daml.daml_lf_dev.DamlLf1.Package, com.daml.daml_lf_dev.DamlLf1.Package.Builder, com.daml.daml_lf_dev.DamlLf1.PackageOrBuilder> damlLf1Builder_;
/**
* .daml_lf_1.Package daml_lf_1 = 2;
* @return Whether the damlLf1 field is set.
*/
@java.lang.Override
public boolean hasDamlLf1() {
return sumCase_ == 2;
}
/**
* .daml_lf_1.Package daml_lf_1 = 2;
* @return The damlLf1.
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf1.Package getDamlLf1() {
if (damlLf1Builder_ == null) {
if (sumCase_ == 2) {
return (com.daml.daml_lf_dev.DamlLf1.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf1.Package.getDefaultInstance();
} else {
if (sumCase_ == 2) {
return damlLf1Builder_.getMessage();
}
return com.daml.daml_lf_dev.DamlLf1.Package.getDefaultInstance();
}
}
/**
* .daml_lf_1.Package daml_lf_1 = 2;
*/
public Builder setDamlLf1(com.daml.daml_lf_dev.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;
*/
public Builder setDamlLf1(
com.daml.daml_lf_dev.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;
*/
public Builder mergeDamlLf1(com.daml.daml_lf_dev.DamlLf1.Package value) {
if (damlLf1Builder_ == null) {
if (sumCase_ == 2 &&
sum_ != com.daml.daml_lf_dev.DamlLf1.Package.getDefaultInstance()) {
sum_ = com.daml.daml_lf_dev.DamlLf1.Package.newBuilder((com.daml.daml_lf_dev.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;
*/
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;
*/
public com.daml.daml_lf_dev.DamlLf1.Package.Builder getDamlLf1Builder() {
return getDamlLf1FieldBuilder().getBuilder();
}
/**
* .daml_lf_1.Package daml_lf_1 = 2;
*/
@java.lang.Override
public com.daml.daml_lf_dev.DamlLf1.PackageOrBuilder getDamlLf1OrBuilder() {
if ((sumCase_ == 2) && (damlLf1Builder_ != null)) {
return damlLf1Builder_.getMessageOrBuilder();
} else {
if (sumCase_ == 2) {
return (com.daml.daml_lf_dev.DamlLf1.Package) sum_;
}
return com.daml.daml_lf_dev.DamlLf1.Package.getDefaultInstance();
}
}
/**
* .daml_lf_1.Package daml_lf_1 = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.daml.daml_lf_dev.DamlLf1.Package, com.daml.daml_lf_dev.DamlLf1.Package.Builder, com.daml.daml_lf_dev.DamlLf1.PackageOrBuilder>
getDamlLf1FieldBuilder() {
if (damlLf1Builder_ == null) {
if (!(sumCase_ == 2)) {
sum_ = com.daml.daml_lf_dev.DamlLf1.Package.getDefaultInstance();
}
damlLf1Builder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.daml.daml_lf_dev.DamlLf1.Package, com.daml.daml_lf_dev.DamlLf1.Package.Builder, com.daml.daml_lf_dev.DamlLf1.PackageOrBuilder>(
(com.daml.daml_lf_dev.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_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 {
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.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();
}
@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.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_;
/**
* .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() {
@SuppressWarnings("deprecation")
com.daml.daml_lf_dev.DamlLf.HashFunction result = com.daml.daml_lf_dev.DamlLf.HashFunction.valueOf(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_;
/**
*
* 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;
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_);
}
unknownFields.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 += 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.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 (!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.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() {
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.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);
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.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_;
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.daml.daml_lf_dev.DamlLf.Archive parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.daml.daml_lf_dev.DamlLf.Archive) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
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;
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() {
@SuppressWarnings("deprecation")
com.daml.daml_lf_dev.DamlLf.HashFunction result = com.daml.daml_lf_dev.DamlLf.HashFunction.valueOf(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();
}
hashFunction_ = value.getNumber();
onChanged();
return this;
}
/**
* .daml_lf_dev.HashFunction hash_function = 1;
* @return This builder for chaining.
*/
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.
*
* 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;
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;
* @return This builder for chaining.
*/
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;
* @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;
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 {
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.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_lf_" +
"1.proto\"]\n\016ArchivePayload\022\r\n\005minor\030\003 \001(\t" +
"\022\'\n\tdaml_lf_1\030\002 \001(\0132\022.daml_lf_1.PackageH" +
"\000B\005\n\003SumJ\006\010\217N\020\220NJ\004\010\001\020\002\"Z\n\007Archive\0220\n\rhas" +
"h_function\030\001 \001(\0162\031.daml_lf_dev.HashFunct" +
"ion\022\017\n\007payload\030\003 \001(\014\022\014\n\004hash\030\004 \001(\t*\032\n\014Ha" +
"shFunction\022\n\n\006SHA256\020\000B4\n\024com.daml.daml_" +
"lf_dev\252\002\033Com.Daml.Daml_Lf_Dev.DamlLfb\006pr" +
"oto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.daml.daml_lf_dev.DamlLf1.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", "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.DamlLf1.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}