main.app.cash.backfila.protos.service.Parameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Backfila is a service that manages backfill state, calling into other services to do batched work.
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: app.cash.backfila.protos.service.Parameter in app/cash/backfila/service.proto
package app.cash.backfila.protos.service;
import com.squareup.wire.FieldEncoding;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoAdapter;
import com.squareup.wire.ProtoReader;
import com.squareup.wire.ProtoWriter;
import com.squareup.wire.ReverseProtoWriter;
import com.squareup.wire.Syntax;
import com.squareup.wire.WireField;
import com.squareup.wire.internal.Internal;
import java.io.IOException;
import java.lang.Boolean;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import okio.ByteString;
/**
* In this file: APIs that the service provides to the client.
*/
public final class Parameter extends Message {
public static final ProtoAdapter ADAPTER = new ProtoAdapter_Parameter();
private static final long serialVersionUID = 0L;
public static final String DEFAULT_NAME = "";
public static final String DEFAULT_DESCRIPTION = "";
public static final Boolean DEFAULT_REQUIRED = false;
@WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING"
)
public final String name;
/**
* Description to show in the UI.
*/
@WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING"
)
public final String description;
@WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#BOOL"
)
public final Boolean required;
public Parameter(String name, String description, Boolean required) {
this(name, description, required, ByteString.EMPTY);
}
public Parameter(String name, String description, Boolean required, ByteString unknownFields) {
super(ADAPTER, unknownFields);
this.name = name;
this.description = description;
this.required = required;
}
@Override
public Builder newBuilder() {
Builder builder = new Builder();
builder.name = name;
builder.description = description;
builder.required = required;
builder.addUnknownFields(unknownFields());
return builder;
}
@Override
public boolean equals(Object other) {
if (other == this) return true;
if (!(other instanceof Parameter)) return false;
Parameter o = (Parameter) other;
return unknownFields().equals(o.unknownFields())
&& Internal.equals(name, o.name)
&& Internal.equals(description, o.description)
&& Internal.equals(required, o.required);
}
@Override
public int hashCode() {
int result = super.hashCode;
if (result == 0) {
result = unknownFields().hashCode();
result = result * 37 + (name != null ? name.hashCode() : 0);
result = result * 37 + (description != null ? description.hashCode() : 0);
result = result * 37 + (required != null ? required.hashCode() : 0);
super.hashCode = result;
}
return result;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
if (name != null) builder.append(", name=").append(Internal.sanitize(name));
if (description != null) builder.append(", description=").append(Internal.sanitize(description));
if (required != null) builder.append(", required=").append(required);
return builder.replace(0, 2, "Parameter{").append('}').toString();
}
public static final class Builder extends Message.Builder {
public String name;
public String description;
public Boolean required;
public Builder() {
}
public Builder name(String name) {
this.name = name;
return this;
}
/**
* Description to show in the UI.
*/
public Builder description(String description) {
this.description = description;
return this;
}
public Builder required(Boolean required) {
this.required = required;
return this;
}
@Override
public Parameter build() {
return new Parameter(name, description, required, super.buildUnknownFields());
}
}
private static final class ProtoAdapter_Parameter extends ProtoAdapter {
public ProtoAdapter_Parameter() {
super(FieldEncoding.LENGTH_DELIMITED, Parameter.class, "type.googleapis.com/app.cash.backfila.protos.service.Parameter", Syntax.PROTO_2, null, "app/cash/backfila/service.proto");
}
@Override
public int encodedSize(Parameter value) {
int result = 0;
result += ProtoAdapter.STRING.encodedSizeWithTag(1, value.name);
result += ProtoAdapter.STRING.encodedSizeWithTag(2, value.description);
result += ProtoAdapter.BOOL.encodedSizeWithTag(3, value.required);
result += value.unknownFields().size();
return result;
}
@Override
public void encode(ProtoWriter writer, Parameter value) throws IOException {
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.name);
ProtoAdapter.STRING.encodeWithTag(writer, 2, value.description);
ProtoAdapter.BOOL.encodeWithTag(writer, 3, value.required);
writer.writeBytes(value.unknownFields());
}
@Override
public void encode(ReverseProtoWriter writer, Parameter value) throws IOException {
writer.writeBytes(value.unknownFields());
ProtoAdapter.BOOL.encodeWithTag(writer, 3, value.required);
ProtoAdapter.STRING.encodeWithTag(writer, 2, value.description);
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.name);
}
@Override
public Parameter decode(ProtoReader reader) throws IOException {
Builder builder = new Builder();
long token = reader.beginMessage();
for (int tag; (tag = reader.nextTag()) != -1;) {
switch (tag) {
case 1: builder.name(ProtoAdapter.STRING.decode(reader)); break;
case 2: builder.description(ProtoAdapter.STRING.decode(reader)); break;
case 3: builder.required(ProtoAdapter.BOOL.decode(reader)); break;
default: {
reader.readUnknownField(tag);
}
}
}
builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));
return builder.build();
}
@Override
public Parameter redact(Parameter value) {
Builder builder = value.newBuilder();
builder.clearUnknownFields();
return builder.build();
}
}
}