org.eclipse.ditto.wot.model.ThingSkeleton Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ditto-wot-model Show documentation
Show all versions of ditto-wot-model Show documentation
Eclipse Ditto is a framework for creating and managing digital twins in the IoT.
The newest version!
/*
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.ditto.wot.model;
import java.time.Instant;
import java.util.Optional;
import javax.annotation.concurrent.Immutable;
import org.eclipse.ditto.base.model.json.Jsonifiable;
import org.eclipse.ditto.json.JsonArray;
import org.eclipse.ditto.json.JsonFactory;
import org.eclipse.ditto.json.JsonFieldDefinition;
import org.eclipse.ditto.json.JsonObject;
/**
* Contains common state/behavior shared by {@link ThingDescription} and {@link ThingModel}.
*
* @param the type of the ThingSkeleton.
* @since 2.4.0
*/
public interface ThingSkeleton> extends TypedJsonObject, Jsonifiable {
AtContext getAtContext();
Optional getAtType();
Optional getId();
Optional getTitle();
Optional getTitles();
Optional getDescription();
Optional getDescriptions();
Optional getVersion();
Optional getBase();
Optional getLinks();
Optional getProperties();
Optional getActions();
Optional getEvents();
Optional getForms();
Optional getUriVariables();
Optional getSecurityDefinitions();
Optional getSchemaDefinitions();
Optional getSupport();
Optional getCreated();
Optional getModified();
Optional getSecurity();
Optional getProfile();
/**
* An enumeration of the known {@link JsonFieldDefinition}s of a Thing Description / Thing Model.
*/
@Immutable
final class JsonFields {
public static final JsonFieldDefinition AT_CONTEXT = JsonFactory.newStringFieldDefinition(
"@context");
public static final JsonFieldDefinition AT_CONTEXT_MULTIPLE =
JsonFactory.newJsonArrayFieldDefinition("@context");
public static final JsonFieldDefinition AT_TYPE = JsonFactory.newStringFieldDefinition(
"@type");
public static final JsonFieldDefinition AT_TYPE_MULTIPLE = JsonFactory.newJsonArrayFieldDefinition(
"@type");
public static final JsonFieldDefinition ID = JsonFactory.newStringFieldDefinition(
"id");
public static final JsonFieldDefinition TITLE = JsonFactory.newStringFieldDefinition(
"title");
public static final JsonFieldDefinition TITLES = JsonFactory.newJsonObjectFieldDefinition(
"titles");
public static final JsonFieldDefinition PROPERTIES = JsonFactory.newJsonObjectFieldDefinition(
"properties");
public static final JsonFieldDefinition ACTIONS = JsonFactory.newJsonObjectFieldDefinition(
"actions");
public static final JsonFieldDefinition EVENTS = JsonFactory.newJsonObjectFieldDefinition(
"events");
public static final JsonFieldDefinition DESCRIPTION = JsonFactory.newStringFieldDefinition(
"description");
public static final JsonFieldDefinition DESCRIPTIONS = JsonFactory.newJsonObjectFieldDefinition(
"descriptions");
public static final JsonFieldDefinition VERSION = JsonFactory.newJsonObjectFieldDefinition(
"version");
public static final JsonFieldDefinition LINKS = JsonFactory.newJsonArrayFieldDefinition(
"links");
public static final JsonFieldDefinition BASE = JsonFactory.newStringFieldDefinition(
"base");
public static final JsonFieldDefinition FORMS = JsonFactory.newJsonArrayFieldDefinition(
"forms");
public static final JsonFieldDefinition URI_VARIABLES =
JsonFactory.newJsonObjectFieldDefinition("uriVariables");
public static final JsonFieldDefinition SECURITY_DEFINITIONS =
JsonFactory.newJsonObjectFieldDefinition("securityDefinitions");
public static final JsonFieldDefinition SCHEMA_DEFINITIONS =
JsonFactory.newJsonObjectFieldDefinition("schemaDefinitions");
public static final JsonFieldDefinition SUPPORT = JsonFactory.newStringFieldDefinition(
"support");
public static final JsonFieldDefinition CREATED = JsonFactory.newStringFieldDefinition(
"created");
public static final JsonFieldDefinition MODIFIED = JsonFactory.newStringFieldDefinition(
"modified");
public static final JsonFieldDefinition SECURITY = JsonFactory.newStringFieldDefinition(
"security");
public static final JsonFieldDefinition SECURITY_MULTIPLE = JsonFactory.newJsonArrayFieldDefinition(
"security");
public static final JsonFieldDefinition PROFILE = JsonFactory.newStringFieldDefinition(
"profile");
public static final JsonFieldDefinition PROFILE_MULTIPLE = JsonFactory.newJsonArrayFieldDefinition(
"profile");
private JsonFields() {
throw new AssertionError();
}
}
}