All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.linkedin.restli.server.CreateKVResponse Maven / Gradle / Ivy

Go to download

Pegasus is a framework for building robust, scalable service architectures using dynamic discovery and simple asychronous type-checked REST + JSON APIs.

The newest version!
package com.linkedin.restli.server;

import com.linkedin.data.template.RecordTemplate;
import com.linkedin.restli.common.HttpStatus;

/**
 * Create a key-value response, enriching the createIdResponse with entity field.
 *
 * @author Boyang Chen
 */
public class CreateKVResponse extends CreateResponse
{
  private final V _entity;

  public CreateKVResponse(final K id, final V entity)
  {
    super(id);
    _entity = entity;
  }

  public CreateKVResponse(final K id, final V entity, HttpStatus status)
  {
    super(id, status);
    _entity = entity;
  }

  public CreateKVResponse(RestLiServiceException error)
  {
    super(error);
    _entity = null;
  }

  public K getId()
  {
    return (K)super.getId();
  }

  public boolean hasEntity()
  {
    return _entity != null;
  }

  public V getEntity()
  {
    return _entity;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy