Package org.eclipse.hono.util
Class BufferResult
- java.lang.Object
-
- org.eclipse.hono.util.RequestResponseResult<io.vertx.core.buffer.Buffer>
-
- org.eclipse.hono.util.BufferResult
-
public final class BufferResult extends RequestResponseResult<io.vertx.core.buffer.Buffer>
A container for the opaque result of a request-response service invocation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BufferResult
from(int status)
Creates a new result for a status code.static BufferResult
from(int status, io.vertx.core.buffer.Buffer payload)
Creates a new result for a status code and a payload.static BufferResult
from(int status, String contentType, io.vertx.core.buffer.Buffer payload)
Creates a new result for a status code and payload.static BufferResult
from(int status, String contentType, io.vertx.core.buffer.Buffer payload, org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties)
Creates a new result for a status code and payload.String
getContentType()
Gets the type of the payload.-
Methods inherited from class org.eclipse.hono.util.RequestResponseResult
getApplicationProperties, getApplicationProperty, getCacheDirective, getPayload, getStatus, isError, isNotFound, isOk
-
-
-
-
Method Detail
-
from
public static BufferResult from(int status)
Creates a new result for a status code.- Parameters:
status
- The status code.- Returns:
- The result.
-
from
public static BufferResult from(int status, io.vertx.core.buffer.Buffer payload)
Creates a new result for a status code and a payload.- Parameters:
status
- The status code.payload
- The payload to include in the result.- Returns:
- The result.
-
from
public static BufferResult from(int status, String contentType, io.vertx.core.buffer.Buffer payload)
Creates a new result for a status code and payload.- Parameters:
status
- The status code.contentType
- A media type describing the payload ornull
if unknown.payload
- The payload to include in the result.- Returns:
- The result.
-
from
public static BufferResult from(int status, String contentType, io.vertx.core.buffer.Buffer payload, org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties)
Creates a new result for a status code and payload.- Parameters:
status
- The status code.contentType
- A media type describing the payload ornull
if unknown.payload
- The payload to include in the result.applicationProperties
- Arbitrary properties conveyed in the response message's application-properties.- Returns:
- The result.
-
getContentType
public String getContentType()
Gets the type of the payload.- Returns:
- The media type describing the payload or
null
if unknown.
-
-