Class APIResource<T extends APIEntity>

java.lang.Object
com.testdroid.api.APIResource<T>

public class APIResource<T extends APIEntity> extends Object
Author:
Ɓukasz Kajda <[email protected]>
  • Field Details

  • Constructor Details

  • Method Details

    • getEntity

      public T getEntity() throws APIException
      Returns the entity owned by this resource. It may be retrieved from server or from cache.
      Throws:
      APIException - on any API errors.
    • getStream

      public InputStream getStream() throws APIException
      Calls API and returns response stream as a result. No cache is used here.
      Returns:
      InputStream from API response
      Throws:
      APIException - on any API errors.
    • update

      public T update() throws APIException
      Updates the entity owned by this resource in server side.
      Returns:
      updated entity
      Throws:
      APIException - on any API errors.
    • delete

      public void delete() throws APIException
      Deletes the entity owned by this resource in server side.
      Throws:
      APIException - on any API errors.
    • refresh

      public void refresh() throws APIException
      Forces retrieving entity from the server side.
      Throws:
      APIException - on any API errors.