public abstract class DomainWrapper<T extends com.abiquo.model.transport.SingleResourceTransportDto> extends Object
Modifier and Type | Field and Description |
---|---|
protected RestContext<AbiquoApi,AbiquoAsyncApi> |
context
The rest context.
|
protected T |
target
The wrapped object.
|
Modifier | Constructor and Description |
---|---|
protected |
DomainWrapper(RestContext<AbiquoApi,AbiquoAsyncApi> context,
T target) |
Modifier and Type | Method and Description |
---|---|
protected Integer |
getParentId(String parentLinkRel)
Read the ID of the parent resource from the given link.
|
protected AsyncTask |
getTask(com.abiquo.model.transport.AcceptedRequestDto<String> acceptedRequest)
Utility method to get an
AsyncTask given an AcceptedRequestDto . |
protected AsyncTask[] |
getTasks(com.abiquo.model.transport.AcceptedRequestDto<String> acceptedRequest)
Utility method to get all
AsyncTask related to an AcceptedRequestDto . |
URI |
getURI()
Returns the URI that identifies the transport object
|
static <T extends com.abiquo.model.transport.SingleResourceTransportDto> |
join(Iterable<? extends com.abiquo.model.transport.WrapperDto<T>> collection)
Join a collection of
WrapperDto objects in a single collection with all the elements
of each wrapper object. |
T |
unwrap()
Returns the wrapped object.
|
static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends DomainWrapper<T>> |
unwrap(Iterable<W> targets)
Unwrap a collection of objects.
|
protected <T1 extends com.abiquo.model.transport.SingleResourceTransportDto,T2 extends com.abiquo.model.transport.SingleResourceTransportDto> |
updateLink(T1 target,
String targetLinkRel,
T2 source,
String sourceLinkRel)
Update or creates a link of "target" with the uri of a link from "source".
|
static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends DomainWrapper<T>> |
wrap(RestContext<AbiquoApi,AbiquoAsyncApi> context,
Class<W> wrapperClass,
Iterable<T> targets)
Wrap a collection of objects to the given wrapper class.
|
static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends DomainWrapper<T>> |
wrap(RestContext<AbiquoApi,AbiquoAsyncApi> context,
Class<W> wrapperClass,
T target)
Wraps an object in the given wrapper class.
|
protected RestContext<AbiquoApi,AbiquoAsyncApi> context
protected T extends com.abiquo.model.transport.SingleResourceTransportDto target
protected DomainWrapper(RestContext<AbiquoApi,AbiquoAsyncApi> context, T target)
public URI getURI()
public T unwrap()
protected Integer getParentId(String parentLinkRel)
parentLinkRel
- The link to the parent resource.public static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends DomainWrapper<T>> W wrap(RestContext<AbiquoApi,AbiquoAsyncApi> context, Class<W> wrapperClass, T target)
public static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends DomainWrapper<T>> List<W> wrap(RestContext<AbiquoApi,AbiquoAsyncApi> context, Class<W> wrapperClass, Iterable<T> targets)
public static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends DomainWrapper<T>> List<T> unwrap(Iterable<W> targets)
protected <T1 extends com.abiquo.model.transport.SingleResourceTransportDto,T2 extends com.abiquo.model.transport.SingleResourceTransportDto> void updateLink(T1 target, String targetLinkRel, T2 source, String sourceLinkRel)
public static <T extends com.abiquo.model.transport.SingleResourceTransportDto> Iterable<T> join(Iterable<? extends com.abiquo.model.transport.WrapperDto<T>> collection)
WrapperDto
objects in a single collection with all the elements
of each wrapper object.protected AsyncTask getTask(com.abiquo.model.transport.AcceptedRequestDto<String> acceptedRequest)
AsyncTask
given an AcceptedRequestDto
.acceptedRequest
- The accepted request dto.Copyright © 2009-2013 jclouds. All Rights Reserved.