public final class ProtocolFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.eclipse.ditto.model.base.headers.DittoHeaders |
emptyHeaders()
Returns new empty
Headers. |
static TopicPath |
emptyTopicPath()
Returns an empty
TopicPath. |
static JsonifiableAdaptable |
jsonifiableAdaptableFromJson(org.eclipse.ditto.json.JsonObject adaptableAsJson)
Converts the passed in
adaptableAsJson to a JsonifiableAdaptable. |
static AdaptableBuilder |
newAdaptableBuilder(Adaptable existingAdaptable)
Returns a new
AdaptableBuilder for the existing existingAdaptable. |
static AdaptableBuilder |
newAdaptableBuilder(Adaptable existingAdaptable,
TopicPath overwriteTopicPath)
Returns a new
AdaptableBuilder for the existing existingAdaptable and a specific
overwriteTopicPath to overwrite the one in existingAdaptable. |
static AdaptableBuilder |
newAdaptableBuilder(TopicPath topicPath)
Returns a new
AdaptableBuilder for the specified topicPath. |
static org.eclipse.ditto.model.base.headers.DittoHeaders |
newHeaders(Collection<Map.Entry<String,String>> headers)
Returns new
Headers for the specified headers map. |
static org.eclipse.ditto.model.base.headers.DittoHeaders |
newHeaders(org.eclipse.ditto.json.JsonObject headersAsJson)
Returns new
Headers for the specified headersAsJson. |
static org.eclipse.ditto.model.base.headers.DittoHeaders |
newHeadersWithDittoContentType(Map<String,String> headers)
Returns new
Headers for the specified headers map. |
static Payload |
newPayload(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new
Payload from the specified jsonObject. |
static Payload |
newPayload(String jsonString)
Returns a new
Payload from the specified jsonString. |
static PayloadBuilder |
newPayloadBuilder()
Returns a new
PayloadBuilder without a path. |
static PayloadBuilder |
newPayloadBuilder(org.eclipse.ditto.json.JsonPointer path)
Returns a new
PayloadBuilder for the specified path. |
static TopicPath |
newTopicPath(String path)
Returns a new
TopicPath for the specified path. |
static TopicPathBuilder |
newTopicPathBuilder(String thingId)
Deprecated.
Thing ID is now typed. Use
newTopicPathBuilder(org.eclipse.ditto.model.things.ThingId)
instead. |
static TopicPathBuilder |
newTopicPathBuilder(org.eclipse.ditto.model.things.ThingId thingId)
Returns a new
TopicPathBuilder for the specified thingId. |
static TopicPathBuilder |
newTopicPathBuilderFromNamespace(String namespace)
Returns a new
TopicPathBuilder. |
static JsonifiableAdaptable |
wrapAsJsonifiableAdaptable(Adaptable adaptable)
Wraps the passed in
adaptable to a JsonifiableAdaptable which has a JSON representation. |
public static AdaptableBuilder newAdaptableBuilder(TopicPath topicPath)
AdaptableBuilder for the specified topicPath.topicPath - the topic path.public static AdaptableBuilder newAdaptableBuilder(Adaptable existingAdaptable)
AdaptableBuilder for the existing existingAdaptable.existingAdaptable - the existingAdaptable to initialize the AdaptableBuilder with.public static AdaptableBuilder newAdaptableBuilder(Adaptable existingAdaptable, TopicPath overwriteTopicPath)
AdaptableBuilder for the existing existingAdaptable and a specific
overwriteTopicPath to overwrite the one in existingAdaptable.existingAdaptable - the existingAdaptable to initialize the AdaptableBuilder with.overwriteTopicPath - the specific TopicPath to set as overwrite.public static TopicPath emptyTopicPath()
TopicPath.public static TopicPath newTopicPath(String path)
TopicPath for the specified path.path - the path.NullPointerException - if path is null.UnknownTopicPathException - if path is no valid TopicPath.@Deprecated public static TopicPathBuilder newTopicPathBuilder(String thingId)
newTopicPathBuilder(org.eclipse.ditto.model.things.ThingId)
instead.TopicPathBuilder for the specified thingId. The namespace and id
part of the TopicPath will pe parsed from the thingId and set in the builder.thingId - the id.NullPointerException - if thingId is null.org.eclipse.ditto.model.things.ThingIdInvalidException - if thingId is not in the expected format.public static TopicPathBuilder newTopicPathBuilder(org.eclipse.ditto.model.things.ThingId thingId)
TopicPathBuilder for the specified thingId. The namespace and id
part of the TopicPath will pe parsed from the thingId and set in the builder.thingId - the id.NullPointerException - if thingId is null.org.eclipse.ditto.model.things.ThingIdInvalidException - if thingId is not in the expected format.public static TopicPathBuilder newTopicPathBuilderFromNamespace(String namespace)
namespace - the namespace.NullPointerException - if namespace is null.public static Payload newPayload(String jsonString)
Payload from the specified jsonString.jsonString - the JSON string.NullPointerException - if jsonString is null.IllegalArgumentException - if jsonString is empty.org.eclipse.ditto.json.JsonParseException - if jsonString does not contain a JSON object.public static Payload newPayload(org.eclipse.ditto.json.JsonObject jsonObject)
Payload from the specified jsonObject.jsonObject - the JSON object.NullPointerException - if jsonObject is null.org.eclipse.ditto.json.JsonParseException - if jsonObject does not have the expected format.public static PayloadBuilder newPayloadBuilder()
PayloadBuilder without a path.public static PayloadBuilder newPayloadBuilder(org.eclipse.ditto.json.JsonPointer path)
PayloadBuilder for the specified path.path - the path.public static org.eclipse.ditto.model.base.headers.DittoHeaders emptyHeaders()
Headers.public static org.eclipse.ditto.model.base.headers.DittoHeaders newHeadersWithDittoContentType(Map<String,String> headers)
Headers for the specified headers map.headers - the headers map.public static org.eclipse.ditto.model.base.headers.DittoHeaders newHeaders(Collection<Map.Entry<String,String>> headers)
Headers for the specified headers map.headers - the headers map.public static org.eclipse.ditto.model.base.headers.DittoHeaders newHeaders(org.eclipse.ditto.json.JsonObject headersAsJson)
Headers for the specified headersAsJson.headersAsJson - the headers as JSON.public static JsonifiableAdaptable wrapAsJsonifiableAdaptable(Adaptable adaptable)
adaptable to a JsonifiableAdaptable which has a JSON representation.adaptable - the already created Adaptable to wrap.public static JsonifiableAdaptable jsonifiableAdaptableFromJson(org.eclipse.ditto.json.JsonObject adaptableAsJson)
adaptableAsJson to a JsonifiableAdaptable.adaptableAsJson - the adaptable as JsonObject.Copyright © 2017–2019 Eclipse Foundation. All rights reserved.