Package org.eclipse.hono.util
Class TenantResult<T>
- java.lang.Object
-
- org.eclipse.hono.util.RequestResponseResult<T>
-
- org.eclipse.hono.util.TenantResult<T>
-
- Type Parameters:
T
- The concrete type of the payload that is conveyed in the result.
public final class TenantResult<T> extends RequestResponseResult<T>
A container for the result returned by Hono's Tenant API.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TenantResult<T>
from(int status)
Creates a new result for a status code.static <T> TenantResult<T>
from(int status, T payload)
Creates a new result for a status code and payload.static <T> TenantResult<T>
from(int status, T payload, CacheDirective cacheDirective)
Creates a new result for a status code and payload.static <T> TenantResult<T>
from(int status, T payload, CacheDirective cacheDirective, org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties)
Creates a new result for a status code and payload.-
Methods inherited from class org.eclipse.hono.util.RequestResponseResult
getApplicationProperties, getApplicationProperty, getCacheDirective, getPayload, getStatus, isError, isNotFound, isOk
-
-
-
-
Method Detail
-
from
public static <T> TenantResult<T> from(int status)
Creates a new result for a status code.- Type Parameters:
T
- The type of the payload conveyed in the result.- Parameters:
status
- The status code indicating the outcome of the request.- Returns:
- The result.
-
from
public static <T> TenantResult<T> from(int status, T payload)
Creates a new result for a status code and payload.- Type Parameters:
T
- The type of the payload conveyed in the result.- Parameters:
status
- The status code indicating the outcome of the request.payload
- The payload to convey to the sender of the request.- Returns:
- The result.
-
from
public static <T> TenantResult<T> from(int status, T payload, CacheDirective cacheDirective)
Creates a new result for a status code and payload.- Type Parameters:
T
- The type of the payload conveyed in the result.- Parameters:
status
- The status code indicating the outcome of the request.payload
- The payload to convey to the sender of the request.cacheDirective
- Restrictions regarding the caching of the payload.- Returns:
- The result.
-
from
public static <T> TenantResult<T> from(int status, T payload, CacheDirective cacheDirective, org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties)
Creates a new result for a status code and payload.- Type Parameters:
T
- The type of the payload conveyed in the result.- Parameters:
status
- The status code indicating the outcome of the request.payload
- The payload to convey to the sender of the request.cacheDirective
- Restrictions regarding the caching of the payload.applicationProperties
- Arbitrary properties conveyed in the response message's application-properties.- Returns:
- The result.
-
-