// Code generated by Wire protocol buffer compiler, do not edit.
// Source file: /Users/klee/AndroidStudioProjects/Scout/core/src/main/java/com/nightscout/core/model/Download.proto
package com.nightscout.core.model;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoField;
import java.util.Collections;
import java.util.List;
import static com.squareup.wire.Message.Datatype.ENUM;
import static com.squareup.wire.Message.Datatype.STRING;
import static com.squareup.wire.Message.Datatype.UINT32;
import static com.squareup.wire.Message.Datatype.UINT64;
import static com.squareup.wire.Message.Label.REPEATED;
import static com.squareup.wire.Message.Label.REQUIRED;
public final class Download extends Message {
public static final List<SensorGlucoseValueEntry> DEFAULT_SGV = Collections.emptyList();
public static final GlucoseUnit DEFAULT_UNITS = GlucoseUnit.MGDL;
public static final String DEFAULT_DOWNLOAD_TIMESTAMP = "";
public static final Long DEFAULT_RECEIVER_SYSTEM_TIME_SEC = 0L;
public static final DownloadStatus DEFAULT_DOWNLOAD_STATUS = DownloadStatus.NOT_APPLICABLE;
public static final Integer DEFAULT_RECEIVER_BATTERY = 0;
public static final Integer DEFAULT_UPLOADER_BATTERY = 0;
public static final List<MeterEntry> DEFAULT_METER = Collections.emptyList();
public static final List<SensorEntry> DEFAULT_SENSOR = Collections.emptyList();
public static final List<CalibrationEntry> DEFAULT_CAL = Collections.emptyList();
public static final List<InsertionEntry> DEFAULT_INSERT = Collections.emptyList();
public static final String DEFAULT_RECEIVER_ID = "";
public static final String DEFAULT_TRANSMITTER_ID = "";
@ProtoField(tag = 1, label = REPEATED)
public final List<SensorGlucoseValueEntry> sgv;
/**
* Glucose records as reported by the G4
*/
@ProtoField(tag = 2, type = ENUM)
public final GlucoseUnit units;
/**
* Units reported by the device
*/
@ProtoField(tag = 3, type = STRING, label = REQUIRED)
public final String download_timestamp;
/**
* ISO8601 timestamp reported by uploader
*/
@ProtoField(tag = 4, type = UINT64)
public final Long receiver_system_time_sec;
/**
* Raw value of the receiver's system time
*/
@ProtoField(tag = 5, type = ENUM)
public final DownloadStatus download_status;
/**
* Status of the download
*/
@ProtoField(tag = 6, type = UINT32)
public final Integer receiver_battery;
/**
* Battery level as reported by the receiver
*/
@ProtoField(tag = 7, type = UINT32)
public final Integer uploader_battery;
/**
* Battery level as reported by the uploader
*/
@ProtoField(tag = 8, label = REPEATED)
public final List<MeterEntry> meter;
@ProtoField(tag = 9, label = REPEATED)
public final List<SensorEntry> sensor;
@ProtoField(tag = 10, label = REPEATED)
public final List<CalibrationEntry> cal;
@ProtoField(tag = 11, label = REPEATED)
public final List<InsertionEntry> insert;
@ProtoField(tag = 12, type = STRING)
public final String receiver_id;
@ProtoField(tag = 13, type = STRING)
public final String transmitter_id;
@ProtoField(tag = 14)
public final ReceiverState receiver_state;
public Download(List<SensorGlucoseValueEntry> sgv, GlucoseUnit units, String download_timestamp, Long receiver_system_time_sec, DownloadStatus download_status, Integer receiver_battery, Integer uploader_battery, List<MeterEntry> meter, List<SensorEntry> sensor, List<CalibrationEntry> cal, List<InsertionEntry> insert, String receiver_id, String transmitter_id, ReceiverState receiver_state) {
this.sgv = immutableCopyOf(sgv);
this.units = units;
this.download_timestamp = download_timestamp;
this.receiver_system_time_sec = receiver_system_time_sec;
this.download_status = download_status;
this.receiver_battery = receiver_battery;
this.uploader_battery = uploader_battery;
this.meter = immutableCopyOf(meter);
this.sensor = immutableCopyOf(sensor);
this.cal = immutableCopyOf(cal);
this.insert = immutableCopyOf(insert);
this.receiver_id = receiver_id;
this.transmitter_id = transmitter_id;
this.receiver_state = receiver_state;
}
private Download(Builder builder) {
this(builder.sgv, builder.units, builder.download_timestamp, builder.receiver_system_time_sec, builder.download_status, builder.receiver_battery, builder.uploader_battery, builder.meter, builder.sensor, builder.cal, builder.insert, builder.receiver_id, builder.transmitter_id, builder.receiver_state);
setBuilder(builder);
}
@Override
public boolean equals(Object other) {
if (other == this) return true;
if (!(other instanceof Download)) return false;
Download o = (Download) other;
return equals(sgv, o.sgv)
&& equals(units, o.units)
&& equals(download_timestamp, o.download_timestamp)
&& equals(receiver_system_time_sec, o.receiver_system_time_sec)
&& equals(download_status, o.download_status)
&& equals(receiver_battery, o.receiver_battery)
&& equals(uploader_battery, o.uploader_battery)
&& equals(meter, o.meter)
&& equals(sensor, o.sensor)
&& equals(cal, o.cal)
&& equals(insert, o.insert)
&& equals(receiver_id, o.receiver_id)
&& equals(transmitter_id, o.transmitter_id)
&& equals(receiver_state, o.receiver_state);
}
@Override
public int hashCode() {
int result = hashCode;
if (result == 0) {
result = sgv != null ? sgv.hashCode() : 1;
result = result * 37 + (units != null ? units.hashCode() : 0);
result = result * 37 + (download_timestamp != null ? download_timestamp.hashCode() : 0);
result = result * 37 + (receiver_system_time_sec != null ? receiver_system_time_sec.hashCode() : 0);
result = result * 37 + (download_status != null ? download_status.hashCode() : 0);
result = result * 37 + (receiver_battery != null ? receiver_battery.hashCode() : 0);
result = result * 37 + (uploader_battery != null ? uploader_battery.hashCode() : 0);
result = result * 37 + (meter != null ? meter.hashCode() : 1);
result = result * 37 + (sensor != null ? sensor.hashCode() : 1);
result = result * 37 + (cal != null ? cal.hashCode() : 1);
result = result * 37 + (insert != null ? insert.hashCode() : 1);
result = result * 37 + (receiver_id != null ? receiver_id.hashCode() : 0);
result = result * 37 + (transmitter_id != null ? transmitter_id.hashCode() : 0);
result = result * 37 + (receiver_state != null ? receiver_state.hashCode() : 0);
hashCode = result;
}
return result;
}
public static final class Builder extends Message.Builder<Download> {
public List<SensorGlucoseValueEntry> sgv;
public GlucoseUnit units;
public String download_timestamp;
public Long receiver_system_time_sec;
public DownloadStatus download_status;
public Integer receiver_battery;
public Integer uploader_battery;
public List<MeterEntry> meter;
public List<SensorEntry> sensor;
public List<CalibrationEntry> cal;
public List<InsertionEntry> insert;
public String receiver_id;
public String transmitter_id;
public ReceiverState receiver_state;
public Builder() {
}
public Builder(Download message) {
super(message);
if (message == null) return;
this.sgv = copyOf(message.sgv);
this.units = message.units;
this.download_timestamp = message.download_timestamp;
this.receiver_system_time_sec = message.receiver_system_time_sec;
this.download_status = message.download_status;
this.receiver_battery = message.receiver_battery;
this.uploader_battery = message.uploader_battery;
this.meter = copyOf(message.meter);
this.sensor = copyOf(message.sensor);
this.cal = copyOf(message.cal);
this.insert = copyOf(message.insert);
this.receiver_id = message.receiver_id;
this.transmitter_id = message.transmitter_id;
this.receiver_state = message.receiver_state;
}
public Builder sgv(List<SensorGlucoseValueEntry> sgv) {
this.sgv = checkForNulls(sgv);
return this;
}
/**
* Glucose records as reported by the G4
*/
public Builder units(GlucoseUnit units) {
this.units = units;
return this;
}
/**
* Units reported by the device
*/
public Builder download_timestamp(String download_timestamp) {
this.download_timestamp = download_timestamp;
return this;
}
/**
* ISO8601 timestamp reported by uploader
*/
public Builder receiver_system_time_sec(Long receiver_system_time_sec) {
this.receiver_system_time_sec = receiver_system_time_sec;
return this;
}
/**
* Raw value of the receiver's system time
*/
public Builder download_status(DownloadStatus download_status) {
this.download_status = download_status;
return this;
}
/**
* Status of the download
*/
public Builder receiver_battery(Integer receiver_battery) {
this.receiver_battery = receiver_battery;
return this;
}
/**
* Battery level as reported by the receiver
*/
public Builder uploader_battery(Integer uploader_battery) {
this.uploader_battery = uploader_battery;
return this;
}
/**
* Battery level as reported by the uploader
*/
public Builder meter(List<MeterEntry> meter) {
this.meter = checkForNulls(meter);
return this;
}
public Builder sensor(List<SensorEntry> sensor) {
this.sensor = checkForNulls(sensor);
return this;
}
public Builder cal(List<CalibrationEntry> cal) {
this.cal = checkForNulls(cal);
return this;
}
public Builder insert(List<InsertionEntry> insert) {
this.insert = checkForNulls(insert);
return this;
}
public Builder receiver_id(String receiver_id) {
this.receiver_id = receiver_id;
return this;
}
public Builder transmitter_id(String transmitter_id) {
this.transmitter_id = transmitter_id;
return this;
}
public Builder receiver_state(ReceiverState receiver_state) {
this.receiver_state = receiver_state;
return this;
}
@Override
public Download build() {
checkRequiredFields();
return new Download(this);
}
}
}