BaseWithReferenceRequest<T> Class

Type Parameters

T

the response class

public abstract class BaseWithReferenceRequest<T>
extends BaseRequest<T>

An HTTP request.

Constructor Summary

Constructor Description
BaseWithReferenceRequest(String requestUrl, IBaseClient<?> client, List<? extends Option> requestOptions, Class<T> entityClass)

The request for the entity

Method Summary

Modifier and Type Method and Description
void delete()

Deletes the entity

java.util.concurrent.CompletableFuture<T> deleteAsync()

Deletes the entity and invokes the callback

T get()

Gets the entity

java.util.concurrent.CompletableFuture<T> getAsync()

Gets the entity an invokes the callback with it

T patch(T sourceObject)

Updates the entity

java.util.concurrent.CompletableFuture<T> patchAsync(T sourceObject)

Updates the entity and invokes the callback

T post(T newEntity, IJsonBackedObject payload)

Creates a new entity and invokes the callback with the result

java.util.concurrent.CompletableFuture<T> postAsync(T newEntity, IJsonBackedObject payload)

Creates a new entity and invokes the callback with the result

Methods inherited from BaseRequest

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

BaseWithReferenceRequest

public BaseWithReferenceRequest(String requestUrl, IBaseClient client, List requestOptions, Class entityClass)

The request for the entity

Parameters:

requestUrl - the request URL
client - the service client
requestOptions - the options for this request
entityClass - the class for the entity

Method Details

delete

public void delete()

Deletes the entity

Throws:

deleteAsync

public CompletableFuture deleteAsync()

Deletes the entity and invokes the callback

Returns:

a future with the result

get

public T get()

Gets the entity

Returns:

the obtained entity

Throws:

getAsync

public CompletableFuture getAsync()

Gets the entity an invokes the callback with it

Returns:

a future with the result

patch

public T patch(T sourceObject)

Updates the entity

Parameters:

sourceObject - object to update

Returns:

the updated entity

Throws:

patchAsync

public CompletableFuture patchAsync(T sourceObject)

Updates the entity and invokes the callback

Parameters:

sourceObject - object to update

Returns:

a future with the result

post

public T post(T newEntity, IJsonBackedObject payload)

Creates a new entity and invokes the callback with the result

Parameters:

newEntity - entity to return
payload - paylod to send to the service

Returns:

the entity once request is executed

Throws:

postAsync

public CompletableFuture postAsync(T newEntity, IJsonBackedObject payload)

Creates a new entity and invokes the callback with the result

Parameters:

newEntity - entity to return
payload - paylod to send to the service

Returns:

a future with the result

Applies to