com.linkedin.restli.common.multiplexer.IndividualResponse Maven / Gradle / Ivy
package com.linkedin.restli.common.multiplexer;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.linkedin.data.DataMap;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.template.DataTemplateUtil;
import com.linkedin.data.template.GetMode;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.data.template.SetMode;
import com.linkedin.data.template.StringMap;
/**
* Individual HTTP response within a multiplexed response
*
*/
@Generated(value = "com.linkedin.pegasus.generator.JavaCodeUtil", comments = "Rest.li Data Template. Generated from /Users/mnchen/dev/pegasus_trunk/pegasus/restli-common/src/main/pegasus/com/linkedin/restli/common/multiplexer/IndividualResponse.pdsc.", date = "Tue Oct 03 15:15:24 PDT 2017")
public class IndividualResponse
extends RecordTemplate
{
private final static IndividualResponse.Fields _fields = new IndividualResponse.Fields();
private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("{\"type\":\"record\",\"name\":\"IndividualResponse\",\"namespace\":\"com.linkedin.restli.common.multiplexer\",\"doc\":\"Individual HTTP response within a multiplexed response\",\"fields\":[{\"name\":\"status\",\"type\":\"int\",\"doc\":\"HTTP status code\"},{\"name\":\"headers\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"doc\":\"HTTP headers\",\"default\":{}},{\"name\":\"body\",\"type\":{\"type\":\"record\",\"name\":\"IndividualBody\",\"doc\":\"Represents content that may be in the body of an individual request / response\",\"fields\":[]},\"doc\":\"Response body\",\"optional\":true}]}"));
private final static RecordDataSchema.Field FIELD_Status = SCHEMA.getField("status");
private final static RecordDataSchema.Field FIELD_Headers = SCHEMA.getField("headers");
private final static RecordDataSchema.Field FIELD_Body = SCHEMA.getField("body");
public IndividualResponse() {
super(new DataMap(), SCHEMA);
}
public IndividualResponse(DataMap data) {
super(data, SCHEMA);
}
public static IndividualResponse.Fields fields() {
return _fields;
}
/**
* Existence checker for status
*
* @see IndividualResponse.Fields#status
*/
public boolean hasStatus() {
return contains(FIELD_Status);
}
/**
* Remover for status
*
* @see IndividualResponse.Fields#status
*/
public void removeStatus() {
remove(FIELD_Status);
}
/**
* Getter for status
*
* @see IndividualResponse.Fields#status
*/
public Integer getStatus(GetMode mode) {
return obtainDirect(FIELD_Status, Integer.class, mode);
}
/**
* Getter for status
*
* @return
* Required field. Could be null for partial record.
* @see IndividualResponse.Fields#status
*/
@Nonnull
public Integer getStatus() {
return obtainDirect(FIELD_Status, Integer.class, GetMode.STRICT);
}
/**
* Setter for status
*
* @see IndividualResponse.Fields#status
*/
public IndividualResponse setStatus(Integer value, SetMode mode) {
putDirect(FIELD_Status, Integer.class, Integer.class, value, mode);
return this;
}
/**
* Setter for status
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see IndividualResponse.Fields#status
*/
public IndividualResponse setStatus(
@Nonnull
Integer value) {
putDirect(FIELD_Status, Integer.class, Integer.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Setter for status
*
* @see IndividualResponse.Fields#status
*/
public IndividualResponse setStatus(int value) {
putDirect(FIELD_Status, Integer.class, Integer.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Existence checker for headers
*
* @see IndividualResponse.Fields#headers
*/
public boolean hasHeaders() {
return contains(FIELD_Headers);
}
/**
* Remover for headers
*
* @see IndividualResponse.Fields#headers
*/
public void removeHeaders() {
remove(FIELD_Headers);
}
/**
* Getter for headers
*
* @see IndividualResponse.Fields#headers
*/
public StringMap getHeaders(GetMode mode) {
return obtainWrapped(FIELD_Headers, StringMap.class, mode);
}
/**
* Getter for headers
*
* @return
* Required field. Could be null for partial record.
* @see IndividualResponse.Fields#headers
*/
@Nonnull
public StringMap getHeaders() {
return obtainWrapped(FIELD_Headers, StringMap.class, GetMode.STRICT);
}
/**
* Setter for headers
*
* @see IndividualResponse.Fields#headers
*/
public IndividualResponse setHeaders(StringMap value, SetMode mode) {
putWrapped(FIELD_Headers, StringMap.class, value, mode);
return this;
}
/**
* Setter for headers
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see IndividualResponse.Fields#headers
*/
public IndividualResponse setHeaders(
@Nonnull
StringMap value) {
putWrapped(FIELD_Headers, StringMap.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Existence checker for body
*
* @see IndividualResponse.Fields#body
*/
public boolean hasBody() {
return contains(FIELD_Body);
}
/**
* Remover for body
*
* @see IndividualResponse.Fields#body
*/
public void removeBody() {
remove(FIELD_Body);
}
/**
* Getter for body
*
* @see IndividualResponse.Fields#body
*/
public IndividualBody getBody(GetMode mode) {
return obtainWrapped(FIELD_Body, IndividualBody.class, mode);
}
/**
* Getter for body
*
* @return
* Optional field. Always check for null.
* @see IndividualResponse.Fields#body
*/
@Nullable
public IndividualBody getBody() {
return obtainWrapped(FIELD_Body, IndividualBody.class, GetMode.STRICT);
}
/**
* Setter for body
*
* @see IndividualResponse.Fields#body
*/
public IndividualResponse setBody(IndividualBody value, SetMode mode) {
putWrapped(FIELD_Body, IndividualBody.class, value, mode);
return this;
}
/**
* Setter for body
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see IndividualResponse.Fields#body
*/
public IndividualResponse setBody(
@Nonnull
IndividualBody value) {
putWrapped(FIELD_Body, IndividualBody.class, value, SetMode.DISALLOW_NULL);
return this;
}
@Override
public IndividualResponse clone()
throws CloneNotSupportedException
{
return ((IndividualResponse) super.clone());
}
@Override
public IndividualResponse copy()
throws CloneNotSupportedException
{
return ((IndividualResponse) super.copy());
}
public static class Fields
extends PathSpec
{
public Fields(List path, String name) {
super(path, name);
}
public Fields() {
super();
}
/**
* HTTP status code
*
*/
public PathSpec status() {
return new PathSpec(getPathComponents(), "status");
}
/**
* HTTP headers
*
*/
public PathSpec headers() {
return new PathSpec(getPathComponents(), "headers");
}
/**
* Response body
*
*/
public com.linkedin.restli.common.multiplexer.IndividualBody.Fields body() {
return new com.linkedin.restli.common.multiplexer.IndividualBody.Fields(getPathComponents(), "body");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy