org.ga4gh.methods.ListReferenceBasesRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ga4gh Show documentation
Show all versions of ga4gh Show documentation
This repository implements GA4GH schemas
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.ga4gh.methods;
@SuppressWarnings("all")
/** The query parameters for a request to `GET /references/{id}/bases`, for
example:
`GET /references/{id}/bases?start=100&end=200` */
@org.apache.avro.specific.AvroGenerated
public class ListReferenceBasesRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ListReferenceBasesRequest\",\"namespace\":\"org.ga4gh.methods\",\"doc\":\"The query parameters for a request to `GET /references/{id}/bases`, for\\nexample:\\n\\n`GET /references/{id}/bases?start=100&end=200`\",\"fields\":[{\"name\":\"start\",\"type\":\"long\",\"doc\":\"The start position (0-based) of this query. Defaults to 0.\\n Genomic positions are non-negative integers less than reference length.\\n Requests spanning the join of circular genomes are represented as\\n two requests one on each side of the join (position 0).\",\"default\":0},{\"name\":\"end\",\"type\":[\"null\",\"long\"],\"doc\":\"The end position (0-based, exclusive) of this query. Defaults\\n to the length of this `Reference`.\",\"default\":null},{\"name\":\"pageToken\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"The continuation token, which is used to page through large result sets.\\n To get the next page of results, set this parameter to the value of\\n `nextPageToken` from the previous response.\",\"default\":null}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
/** The start position (0-based) of this query. Defaults to 0.
Genomic positions are non-negative integers less than reference length.
Requests spanning the join of circular genomes are represented as
two requests one on each side of the join (position 0). */
private long start;
/** The end position (0-based, exclusive) of this query. Defaults
to the length of this `Reference`. */
private java.lang.Long end;
/** The continuation token, which is used to page through large result sets.
To get the next page of results, set this parameter to the value of
`nextPageToken` from the previous response. */
private java.lang.String pageToken;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder()
.
*/
public ListReferenceBasesRequest() {}
/**
* All-args constructor.
*/
public ListReferenceBasesRequest(java.lang.Long start, java.lang.Long end, java.lang.String pageToken) {
this.start = start;
this.end = end;
this.pageToken = pageToken;
}
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return start;
case 1: return end;
case 2: return pageToken;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: start = (java.lang.Long)value$; break;
case 1: end = (java.lang.Long)value$; break;
case 2: pageToken = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'start' field.
* The start position (0-based) of this query. Defaults to 0.
Genomic positions are non-negative integers less than reference length.
Requests spanning the join of circular genomes are represented as
two requests one on each side of the join (position 0). */
public java.lang.Long getStart() {
return start;
}
/**
* Sets the value of the 'start' field.
* The start position (0-based) of this query. Defaults to 0.
Genomic positions are non-negative integers less than reference length.
Requests spanning the join of circular genomes are represented as
two requests one on each side of the join (position 0). * @param value the value to set.
*/
public void setStart(java.lang.Long value) {
this.start = value;
}
/**
* Gets the value of the 'end' field.
* The end position (0-based, exclusive) of this query. Defaults
to the length of this `Reference`. */
public java.lang.Long getEnd() {
return end;
}
/**
* Sets the value of the 'end' field.
* The end position (0-based, exclusive) of this query. Defaults
to the length of this `Reference`. * @param value the value to set.
*/
public void setEnd(java.lang.Long value) {
this.end = value;
}
/**
* Gets the value of the 'pageToken' field.
* The continuation token, which is used to page through large result sets.
To get the next page of results, set this parameter to the value of
`nextPageToken` from the previous response. */
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Sets the value of the 'pageToken' field.
* The continuation token, which is used to page through large result sets.
To get the next page of results, set this parameter to the value of
`nextPageToken` from the previous response. * @param value the value to set.
*/
public void setPageToken(java.lang.String value) {
this.pageToken = value;
}
/** Creates a new ListReferenceBasesRequest RecordBuilder */
public static org.ga4gh.methods.ListReferenceBasesRequest.Builder newBuilder() {
return new org.ga4gh.methods.ListReferenceBasesRequest.Builder();
}
/** Creates a new ListReferenceBasesRequest RecordBuilder by copying an existing Builder */
public static org.ga4gh.methods.ListReferenceBasesRequest.Builder newBuilder(org.ga4gh.methods.ListReferenceBasesRequest.Builder other) {
return new org.ga4gh.methods.ListReferenceBasesRequest.Builder(other);
}
/** Creates a new ListReferenceBasesRequest RecordBuilder by copying an existing ListReferenceBasesRequest instance */
public static org.ga4gh.methods.ListReferenceBasesRequest.Builder newBuilder(org.ga4gh.methods.ListReferenceBasesRequest other) {
return new org.ga4gh.methods.ListReferenceBasesRequest.Builder(other);
}
/**
* RecordBuilder for ListReferenceBasesRequest instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private long start;
private java.lang.Long end;
private java.lang.String pageToken;
/** Creates a new Builder */
private Builder() {
super(org.ga4gh.methods.ListReferenceBasesRequest.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.ga4gh.methods.ListReferenceBasesRequest.Builder other) {
super(other);
if (isValidValue(fields()[0], other.start)) {
this.start = data().deepCopy(fields()[0].schema(), other.start);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.end)) {
this.end = data().deepCopy(fields()[1].schema(), other.end);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.pageToken)) {
this.pageToken = data().deepCopy(fields()[2].schema(), other.pageToken);
fieldSetFlags()[2] = true;
}
}
/** Creates a Builder by copying an existing ListReferenceBasesRequest instance */
private Builder(org.ga4gh.methods.ListReferenceBasesRequest other) {
super(org.ga4gh.methods.ListReferenceBasesRequest.SCHEMA$);
if (isValidValue(fields()[0], other.start)) {
this.start = data().deepCopy(fields()[0].schema(), other.start);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.end)) {
this.end = data().deepCopy(fields()[1].schema(), other.end);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.pageToken)) {
this.pageToken = data().deepCopy(fields()[2].schema(), other.pageToken);
fieldSetFlags()[2] = true;
}
}
/** Gets the value of the 'start' field */
public java.lang.Long getStart() {
return start;
}
/** Sets the value of the 'start' field */
public org.ga4gh.methods.ListReferenceBasesRequest.Builder setStart(long value) {
validate(fields()[0], value);
this.start = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'start' field has been set */
public boolean hasStart() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'start' field */
public org.ga4gh.methods.ListReferenceBasesRequest.Builder clearStart() {
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'end' field */
public java.lang.Long getEnd() {
return end;
}
/** Sets the value of the 'end' field */
public org.ga4gh.methods.ListReferenceBasesRequest.Builder setEnd(java.lang.Long value) {
validate(fields()[1], value);
this.end = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'end' field has been set */
public boolean hasEnd() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'end' field */
public org.ga4gh.methods.ListReferenceBasesRequest.Builder clearEnd() {
end = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'pageToken' field */
public java.lang.String getPageToken() {
return pageToken;
}
/** Sets the value of the 'pageToken' field */
public org.ga4gh.methods.ListReferenceBasesRequest.Builder setPageToken(java.lang.String value) {
validate(fields()[2], value);
this.pageToken = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'pageToken' field has been set */
public boolean hasPageToken() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'pageToken' field */
public org.ga4gh.methods.ListReferenceBasesRequest.Builder clearPageToken() {
pageToken = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public ListReferenceBasesRequest build() {
try {
ListReferenceBasesRequest record = new ListReferenceBasesRequest();
record.start = fieldSetFlags()[0] ? this.start : (java.lang.Long) defaultValue(fields()[0]);
record.end = fieldSetFlags()[1] ? this.end : (java.lang.Long) defaultValue(fields()[1]);
record.pageToken = fieldSetFlags()[2] ? this.pageToken : (java.lang.String) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}