Package org.eclipse.ditto.model.things
Class ThingsModelFactory
- java.lang.Object
-
- org.eclipse.ditto.model.things.ThingsModelFactory
-
@Immutable public final class ThingsModelFactory extends Object
Factory that creates newthings
objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Permissions
allPermissions()
Deprecated.Permissions belong to deprecated API version 1.static AccessControlList
emptyAcl()
Deprecated.AccessControlLists belong to deprecated API version 1.static Attributes
emptyAttributes()
Returns a new immutable emptyAttributes
.static FeatureProperties
emptyFeatureProperties()
Returns a new immutable emptyFeatureProperties
.static Features
emptyFeatures()
Returns a new immutable emptyFeatures
.static AccessControlList
newAcl(Iterable<AclEntry> entries)
Deprecated.AccessControlLists belong to deprecated API version 1.static AccessControlList
newAcl(String jsonString)
Deprecated.AccessControlLists belong to deprecated API version 1.static AccessControlList
newAcl(org.eclipse.ditto.json.JsonObject jsonObject)
Deprecated.AccessControlLists belong to deprecated API version 1.static AccessControlList
newAcl(AclEntry entry, AclEntry... furtherEntries)
Deprecated.AccessControlLists belong to deprecated API version 1.static AccessControlListBuilder
newAclBuilder()
Deprecated.AccessControlLists belong to deprecated API version 1.static AccessControlListBuilder
newAclBuilder(Iterable<AclEntry> aclEntries)
Deprecated.AccessControlLists belong to deprecated API version 1.static AccessControlListBuilder
newAclBuilder(Optional<? extends Iterable<AclEntry>> aclEntries)
Deprecated.AccessControlLists belong to deprecated API version 1.static AclEntry
newAclEntry(CharSequence authorizationSubjectId, org.eclipse.ditto.json.JsonValue permissionsValue)
Deprecated.AccessControlLists belong to deprecated API version 1.static AclEntry
newAclEntry(org.eclipse.ditto.json.JsonObject jsonObject)
Deprecated.AccessControlLists belong to deprecated API version 1.static AclEntry
newAclEntry(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Iterable<Permission> permissions)
Deprecated.AccessControlLists belong to deprecated API version 1.static AclEntry
newAclEntry(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Permission permission, Permission... furtherPermissions)
Deprecated.AccessControlLists belong to deprecated API version 1.static Attributes
newAttributes(String jsonString)
Returns a new immutableAttributes
which is initialised with the values of the given JSON string.static Attributes
newAttributes(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableAttributes
which is initialised with the values of the given JSON object.static AttributesBuilder
newAttributesBuilder()
Returns a new empty builder for aAttributes
.static AttributesBuilder
newAttributesBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new builder for aAttributes
which is initialised with the values of the given JSON object.static ThingDefinition
newDefinition(CharSequence thingDefinition)
Returns a new immutableThingDefinition
which is initialised with the parsedthingDefinition
.static Feature
newFeature(String featureId)
Returns a new immutableFeature
with the given ID.static Feature
newFeature(String featureId, FeatureDefinition featureDefinition)
Returns a new immutableFeature
with the given ID, properties and Definition.static Feature
newFeature(String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties)
Returns a new immutableFeature
with the given ID, properties and Definition.static Feature
newFeature(String featureId, FeatureProperties featureProperties)
Returns a new immutableFeature
with the given ID and properties.static FeatureBuilder.FromScratchBuildable
newFeatureBuilder()
Returns a new builder for an immutableFeature
from scratch with a fluent API.static FeatureBuilder.FromJsonBuildable
newFeatureBuilder(String jsonString)
Returns a new builder for an immutableFeature
which is initialised with the values of the given JSON string.static FeatureBuilder.FromJsonBuildable
newFeatureBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new builder for an immutableFeature
which is initialised with the values of the given JSON object.static FeatureBuilder.FromCopyBuildable
newFeatureBuilder(Feature feature)
Returns a new builder for an immutableFeature
which is initialised with the values of the given Feature.static FeatureDefinition
newFeatureDefinition(String jsonString)
Returns a new immutableFeatureDefinition
which is initialised with the values of the given JSON string.static FeatureDefinition
newFeatureDefinition(org.eclipse.ditto.json.JsonArray jsonArray)
Parses the specified JsonArray and returns an immutable instance ofFeatureDefinition
which is initialised with the values of the given JSON array.static FeatureDefinitionBuilder
newFeatureDefinitionBuilder(CharSequence firstIdentifier)
Parses the specified CharSequence and returns a mutable builder with a fluent API for an immutableFeatureDefinition
.static FeatureDefinitionBuilder
newFeatureDefinitionBuilder(org.eclipse.ditto.json.JsonArray jsonArray)
Returns a new builder for an immutableFeatureDefinition
which is initialised with the values of the given JSON array.static DefinitionIdentifier
newFeatureDefinitionIdentifier(CharSequence featureIdentifierAsCharSequence)
Parses the specified CharSequence and returns an immutable instance ofDefinitionIdentifier
.static DefinitionIdentifier
newFeatureDefinitionIdentifier(CharSequence namespace, CharSequence name, CharSequence version)
Returns an immutable instance ofDefinitionIdentifier
.static FeatureProperties
newFeatureProperties(String jsonString)
Returns a new immutableFeatureProperties
which is initialised with the values of the given JSON string.static FeatureProperties
newFeatureProperties(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableFeatureProperties
which is initialised with the values of the given JSON object.static FeaturePropertiesBuilder
newFeaturePropertiesBuilder()
Returns a new empty builder for an immutableFeatureProperties
.static FeaturePropertiesBuilder
newFeaturePropertiesBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new builder for an immutableFeatureProperties
which is initialised with the values of the given JSON object.static Features
newFeatures(Iterable<Feature> features)
Returns a new immutableFeatures
which is initialised with the features of the given Iterable.static Features
newFeatures(String jsonString)
Returns a new immutableFeatures
based on the given JSON string.static Features
newFeatures(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableFeatures
based on the given JSON object.static Features
newFeatures(Feature feature, Feature... additionalFeatures)
Returns a new immutableFeatures
which is initialised with the given features.static FeaturesBuilder
newFeaturesBuilder()
Returns a new mutable builder with a fluent API for an immutableFeatures
.static FeaturesBuilder
newFeaturesBuilder(Iterable<Feature> features)
Returns a new mutable builder with a fluent API for an immutableFeatures
.static Permissions
newPermissions(Collection<Permission> permissions)
Deprecated.Permissions belong to deprecated API version 1.static Permissions
newPermissions(Permission permission, Permission... furtherPermissions)
Deprecated.Permissions belong to deprecated API version 1.static Thing
newThing(String jsonString)
Returns a new immutableThing
based on the given JSON string.static Thing
newThing(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableThing
based on the given JSON object.static ThingBuilder.FromScratch
newThingBuilder()
Returns a mutable builder with a fluent API for an immutableThing
from scratch.static ThingBuilder.FromCopy
newThingBuilder(String jsonString)
Returns a mutable builder with a fluent API for an immutableThing
based on the given JSON string.static ThingBuilder.FromCopy
newThingBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a mutable builder with a fluent API for an immutableThing
based on the given JSON object.static ThingBuilder.FromCopy
newThingBuilder(Thing thing)
Returns a mutable builder with a fluent API for an immutableThing
.static ThingRevision
newThingRevision(long revisionNumber)
Returns a new immutableThingRevision
which is initialised with the given revision number.static Permissions
newUnmodifiablePermissions(Permission permission, Permission... furtherPermissions)
Deprecated.Permissions belong to deprecated API version 1.static Permissions
noPermissions()
Deprecated.Permissions belong to deprecated API version 1.static Attributes
nullAttributes()
Returns a new immutableAttributes
which representsnull
.static ThingDefinition
nullDefinition()
Returns a new immutableThingDefinition
which representsnull
.static Feature
nullFeature(String featureId)
Returns a new immutableFeature
which representsnull
.static FeatureDefinition
nullFeatureDefinition()
Returns a new immutableFeatureDefinition
which representsnull
.static FeatureProperties
nullFeatureProperties()
Returns a new immutableFeatureProperties
which representsnull
.static Features
nullFeatures()
Returns a new immutableFeatures
which representsnull
.
-
-
-
Method Detail
-
emptyAttributes
public static Attributes emptyAttributes()
Returns a new immutable emptyAttributes
.- Returns:
- the new immutable empty
Attributes
.
-
nullAttributes
public static Attributes nullAttributes()
Returns a new immutableAttributes
which representsnull
.- Returns:
- the new
null
-likeAttributes
.
-
newAttributes
public static Attributes newAttributes(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableAttributes
which is initialised with the values of the given JSON object.- Parameters:
jsonObject
- provides the initial values of the result.- Returns:
- the new immutable initialised
Attributes
. - Throws:
NullPointerException
- ifjsonObject
isnull
.
-
newAttributes
public static Attributes newAttributes(String jsonString)
Returns a new immutableAttributes
which is initialised with the values of the given JSON string. This string is required to be a validJsonObject
.- Parameters:
jsonString
- provides the initial values of the result;- Returns:
- the new immutable initialised
Attributes
. - Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toAttributes
.
-
newAttributesBuilder
public static AttributesBuilder newAttributesBuilder()
Returns a new empty builder for aAttributes
.- Returns:
- the builder.
-
newAttributesBuilder
public static AttributesBuilder newAttributesBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new builder for aAttributes
which is initialised with the values of the given JSON object.- Parameters:
jsonObject
- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException
- ifjsonObject
isnull
.
-
newDefinition
public static ThingDefinition newDefinition(@Nullable CharSequence thingDefinition)
Returns a new immutableThingDefinition
which is initialised with the parsedthingDefinition
.- Parameters:
thingDefinition
- Definition identifier which should be parsed as ThingDefinition.- Returns:
- new ThingDefinition with the parsed definition identifier.
-
nullDefinition
public static ThingDefinition nullDefinition()
Returns a new immutableThingDefinition
which representsnull
.- Returns:
- the new
null
-likeThingDefinition
.
-
newFeatureDefinitionIdentifier
public static DefinitionIdentifier newFeatureDefinitionIdentifier(CharSequence namespace, CharSequence name, CharSequence version)
Returns an immutable instance ofDefinitionIdentifier
.- Parameters:
namespace
- the namespace of the returned Identifier.name
- the name of the returned Identifier.version
- the version of the returned Identifier.- Returns:
- the instance.
- Throws:
NullPointerException
- if any argument isnull
.IllegalArgumentException
- if any argument is empty.
-
newFeatureDefinitionIdentifier
public static DefinitionIdentifier newFeatureDefinitionIdentifier(CharSequence featureIdentifierAsCharSequence)
Parses the specified CharSequence and returns an immutable instance ofDefinitionIdentifier
.- Parameters:
featureIdentifierAsCharSequence
- CharSequence-representation of a FeatureDefinition Identifier.- Returns:
- the instance.
- Throws:
NullPointerException
- iffeatureIdentifierAsCharSequence
isnull
.DefinitionIdentifierInvalidException
- iffeatureIdentifierAsCharSequence
is invalid.
-
newFeatureDefinition
public static FeatureDefinition newFeatureDefinition(org.eclipse.ditto.json.JsonArray jsonArray)
Parses the specified JsonArray and returns an immutable instance ofFeatureDefinition
which is initialised with the values of the given JSON array.- Parameters:
jsonArray
- JSON array containing the identifiers of the FeatureDefinition to be returned. Non-string values are ignored.- Returns:
- the instance.
- Throws:
NullPointerException
- ifjsonArray
isnull
.FeatureDefinitionEmptyException
- ifjsonArray
is empty.DefinitionIdentifierInvalidException
- if any Identifier string of the array is invalid.
-
newFeatureDefinition
public static FeatureDefinition newFeatureDefinition(String jsonString)
Returns a new immutableFeatureDefinition
which is initialised with the values of the given JSON string. This string is required to be a validJsonArray
.- Parameters:
jsonString
- provides the initial values of the result;- Returns:
- the new immutable initialised
FeatureDefinition
. - Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toFeatureDefinition
.FeatureDefinitionEmptyException
- if the JSON array is empty.DefinitionIdentifierInvalidException
- if any Identifier of the JSON array is invalid.
-
nullFeatureDefinition
public static FeatureDefinition nullFeatureDefinition()
Returns a new immutableFeatureDefinition
which representsnull
.- Returns:
- the new
null
-likeFeatureDefinition
.
-
newFeatureDefinitionBuilder
public static FeatureDefinitionBuilder newFeatureDefinitionBuilder(CharSequence firstIdentifier)
Parses the specified CharSequence and returns a mutable builder with a fluent API for an immutableFeatureDefinition
. The returned builder is initialised with the parsed Identifier as its first one.- Parameters:
firstIdentifier
- CharSequence-representation of the first FeatureDefinition Identifier.- Returns:
- the instance.
- Throws:
NullPointerException
- iffirstIdentifier
isnull
.DefinitionIdentifierInvalidException
- iffirstIdentifier
is invalid.
-
newFeatureDefinitionBuilder
public static FeatureDefinitionBuilder newFeatureDefinitionBuilder(org.eclipse.ditto.json.JsonArray jsonArray)
Returns a new builder for an immutableFeatureDefinition
which is initialised with the values of the given JSON array.- Parameters:
jsonArray
- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException
- ifjsonArray
isnull
.DefinitionIdentifierInvalidException
- if any Identifier of the array is invalid.
-
emptyFeatureProperties
public static FeatureProperties emptyFeatureProperties()
Returns a new immutable emptyFeatureProperties
.- Returns:
- the new immutable empty
FeatureProperties
.
-
nullFeatureProperties
public static FeatureProperties nullFeatureProperties()
Returns a new immutableFeatureProperties
which representsnull
.- Returns:
- the new
null
-likeFeatureProperties
.
-
newFeatureProperties
public static FeatureProperties newFeatureProperties(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableFeatureProperties
which is initialised with the values of the given JSON object.- Parameters:
jsonObject
- provides the initial values of the result.- Returns:
- the new immutable initialised
FeatureProperties
. - Throws:
NullPointerException
- ifjsonObject
isnull
.
-
newFeatureProperties
public static FeatureProperties newFeatureProperties(String jsonString)
Returns a new immutableFeatureProperties
which is initialised with the values of the given JSON string. This string is required to be a validJsonObject
.- Parameters:
jsonString
- provides the initial values of the result;- Returns:
- the new immutable initialised
FeatureProperties
. - Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toFeatureProperties
.
-
newFeaturePropertiesBuilder
public static FeaturePropertiesBuilder newFeaturePropertiesBuilder()
Returns a new empty builder for an immutableFeatureProperties
.- Returns:
- the builder.
-
newFeaturePropertiesBuilder
public static FeaturePropertiesBuilder newFeaturePropertiesBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new builder for an immutableFeatureProperties
which is initialised with the values of the given JSON object.- Parameters:
jsonObject
- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException
- ifjsonObject
isnull
.
-
nullFeature
public static Feature nullFeature(String featureId)
Returns a new immutableFeature
which representsnull
.- Parameters:
featureId
- the ID of the new Feature.- Returns:
- the new
null
-likeFeature
. - Throws:
NullPointerException
- iffeatureId
isnull
.
-
newFeature
public static Feature newFeature(String featureId)
Returns a new immutableFeature
with the given ID.- Parameters:
featureId
- the ID of the new Feature.- Returns:
- the new immutable
Feature
. - Throws:
NullPointerException
- iffeatureId
isnull
.
-
newFeature
public static Feature newFeature(String featureId, @Nullable FeatureProperties featureProperties)
Returns a new immutableFeature
with the given ID and properties.- Parameters:
featureId
- the ID of the new feature.featureProperties
- the properties of the new Feature ornull
.- Returns:
- the new immutable
Feature
. - Throws:
NullPointerException
- iffeatureId
isnull
.
-
newFeature
public static Feature newFeature(String featureId, @Nullable FeatureDefinition featureDefinition)
Returns a new immutableFeature
with the given ID, properties and Definition.- Parameters:
featureId
- the ID of the new feature.featureDefinition
- the Definition of the new Feature ornull
.- Returns:
- the new immutable
Feature
. - Throws:
NullPointerException
- iffeatureId
isnull
.
-
newFeature
public static Feature newFeature(String featureId, @Nullable FeatureDefinition featureDefinition, @Nullable FeatureProperties featureProperties)
Returns a new immutableFeature
with the given ID, properties and Definition.- Parameters:
featureId
- the ID of the new feature.featureDefinition
- the Definition of the new Feature ornull
.featureProperties
- the properties of the new Feature ornull
.- Returns:
- the new immutable
Feature
. - Throws:
NullPointerException
- iffeatureId
isnull
.
-
newFeatureBuilder
public static FeatureBuilder.FromScratchBuildable newFeatureBuilder()
Returns a new builder for an immutableFeature
from scratch with a fluent API.- Returns:
- the builder.
-
newFeatureBuilder
public static FeatureBuilder.FromCopyBuildable newFeatureBuilder(Feature feature)
Returns a new builder for an immutableFeature
which is initialised with the values of the given Feature.- Parameters:
feature
- provides the initial values for the result.- Returns:
- the builder.
- Throws:
NullPointerException
- iffeature
isnull
.
-
newFeatureBuilder
public static FeatureBuilder.FromJsonBuildable newFeatureBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new builder for an immutableFeature
which is initialised with the values of the given JSON object.- Parameters:
jsonObject
- provides the initial values for the result.- Returns:
- the builder.
- Throws:
NullPointerException
- ifjsonObject
isnull
.
-
newFeatureBuilder
public static FeatureBuilder.FromJsonBuildable newFeatureBuilder(String jsonString)
Returns a new builder for an immutableFeature
which is initialised with the values of the given JSON string. The JSON string is parsed in a fault tolerant way. I. e. all properties which cannot be deserialized are supposed to not exist.- Parameters:
jsonString
- string the JSON string representation of a Feature.- Returns:
- the builder.
- Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toFeature
.- See Also:
newFeatureBuilder(JsonObject)
-
emptyFeatures
public static Features emptyFeatures()
Returns a new immutable emptyFeatures
.- Returns:
- the new immutable empty
Features
.
-
nullFeatures
public static Features nullFeatures()
Returns a new immutableFeatures
which representsnull
.- Returns:
- the new
null
-likeFeatures
.
-
newFeatures
public static Features newFeatures(Iterable<Feature> features)
Returns a new immutableFeatures
which is initialised with the features of the given Iterable.- Parameters:
features
- the features to initialise the result with.- Returns:
- the new immutable
Features
which is initialised withfeatures
. - Throws:
NullPointerException
- iffeatures
isnull
.
-
newFeatures
public static Features newFeatures(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableFeatures
based on the given JSON object.- Parameters:
jsonObject
- provides the initial values for the result.- Returns:
- the new immutable
Features
which is initialised by the data ofjsonObject
. - Throws:
NullPointerException
- ifjsonObject
isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- if any JSON field which is supposed to represent a Feature is not a JSON object.
-
newFeatures
public static Features newFeatures(String jsonString)
Returns a new immutableFeatures
based on the given JSON string.- Parameters:
jsonString
- provides the initial values of the result.- Returns:
- the new immutable initialised
Features
. - Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toFeatures
.
-
newFeatures
public static Features newFeatures(Feature feature, Feature... additionalFeatures)
Returns a new immutableFeatures
which is initialised with the given features.- Parameters:
feature
- the initial Feature of the result.additionalFeatures
- additional features of the result.- Returns:
- the new immutable
Features
which is initialised withfeature
and potentially withadditionalFeatures
. - Throws:
NullPointerException
- if any argument isnull
.
-
newFeaturesBuilder
public static FeaturesBuilder newFeaturesBuilder()
Returns a new mutable builder with a fluent API for an immutableFeatures
.- Returns:
- the builder.
-
newFeaturesBuilder
public static FeaturesBuilder newFeaturesBuilder(Iterable<Feature> features)
Returns a new mutable builder with a fluent API for an immutableFeatures
. The builder is initialised with the given features.- Parameters:
features
- the initial features of the new builder.- Returns:
- the builder.
- Throws:
NullPointerException
- iffeatures
isnull
.
-
newThingRevision
public static ThingRevision newThingRevision(long revisionNumber)
Returns a new immutableThingRevision
which is initialised with the given revision number.- Parameters:
revisionNumber
- thelong
value of the revision.- Returns:
- the new immutable
ThingRevision
.
-
noPermissions
@Deprecated public static Permissions noPermissions()
Deprecated.Permissions belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new empty mutablePermissions
.- Returns:
- the new
Permissions
.
-
allPermissions
public static Permissions allPermissions()
Deprecated.Permissions belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new mutablePermissions
containing all available permissions.- Returns:
- the new
Permissions
. - See Also:
Permission.values()
-
newPermissions
public static Permissions newPermissions(Collection<Permission> permissions)
Deprecated.Permissions belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new mutablePermissions
containing the given permissions.- Parameters:
permissions
- the permissions to initialise the result with.- Returns:
- the new
Permissions
. - Throws:
NullPointerException
- ifpermissions
isnull
;
-
newPermissions
public static Permissions newPermissions(Permission permission, Permission... furtherPermissions)
Deprecated.Permissions belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new mutablePermissions
containing the given permissions.- Parameters:
permission
- the mandatory permission to be contained in the result.furtherPermissions
- additional permissions to be contained in the result.- Returns:
- the new
Permissions
. - Throws:
NullPointerException
- if any argument isnull
.
-
newUnmodifiablePermissions
public static Permissions newUnmodifiablePermissions(Permission permission, Permission... furtherPermissions)
Deprecated.Permissions belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new unmodifiablePermissions
containing the given permissions.- Parameters:
permission
- the mandatory permission to be contained in the result.furtherPermissions
- additional permissions to be contained in the result.- Returns:
- the new
Permissions
. - Throws:
NullPointerException
- if any argument isnull
.
-
newAclEntry
public static AclEntry newAclEntry(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Permission permission, Permission... furtherPermissions)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutableAclEntry
with the given authorization subject and permissions.- Parameters:
authorizationSubject
- the authorization subject of the new ACL entry.permission
- the permission of the new ACL entry.furtherPermissions
- additional permission of the new ACL entry.- Returns:
- the new ACL entry.
- Throws:
NullPointerException
- if any argument isnull
.
-
newAclEntry
public static AclEntry newAclEntry(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Iterable<Permission> permissions)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutableAclEntry
with the given authorization subject and permissions.- Parameters:
authorizationSubject
- the authorization subject of the new ACL entry.permissions
- the permissions of the new ACL entry.- Returns:
- the new ACL entry.
- Throws:
NullPointerException
- if any argument isnull
.
-
newAclEntry
public static AclEntry newAclEntry(org.eclipse.ditto.json.JsonObject jsonObject)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutableAclEntry
based on the given JSON object.- Parameters:
jsonObject
- provides the initial values for the result.- Returns:
- the new ACL entry.
- Throws:
NullPointerException
- ifjsonObject
isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonObject
cannot be parsed.
-
newAclEntry
@Deprecated public static AclEntry newAclEntry(CharSequence authorizationSubjectId, org.eclipse.ditto.json.JsonValue permissionsValue)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutableAclEntry
with the given authorization subject ID and the given JSON value which provides the permissions.- Parameters:
authorizationSubjectId
- the ID of the authorization subject of the new ACL entry.permissionsValue
- a JSON value which represents the permissions of the authorization subject of the new ACL entry. This value is supposed to be a JSON object.- Returns:
- the new ACL entry.
- Throws:
NullPointerException
- if any argument isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifpermissionsValue
is not a JSON object.AclEntryInvalidException
- ifpermissionsValue
does not contain aboolean
value for the required permissions.
-
newAclBuilder
@Deprecated public static AccessControlListBuilder newAclBuilder()
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a mutable builder with a fluent API for an immutableAccessControlList
.- Returns:
- the new builder.
-
newAclBuilder
@Deprecated public static AccessControlListBuilder newAclBuilder(Iterable<AclEntry> aclEntries)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a mutable builder with a fluent API for an immutableAccessControlList
. The builder is initialised with the given ACL entries.- Parameters:
aclEntries
- the initial entries of the new builder.- Returns:
- the new builder.
- Throws:
NullPointerException
- ifaclEntries
isnull
.
-
newAclBuilder
@Deprecated public static AccessControlListBuilder newAclBuilder(Optional<? extends Iterable<AclEntry>> aclEntries)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a mutable builder with a fluent API for an immutableAccessControlList
. The builder is initialised with the given ACL entries.- Parameters:
aclEntries
- the initial entries of the new builder.- Returns:
- the new builder.
- Throws:
NullPointerException
- ifaclEntries
isnull
.
-
emptyAcl
@Deprecated public static AccessControlList emptyAcl()
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new empty immutableAccessControlList
.- Returns:
- the new ACL.
-
newAcl
@Deprecated public static AccessControlList newAcl(AclEntry entry, AclEntry... furtherEntries)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutable Access Control List (ACL) which is initialised with the specified entries.- Parameters:
entry
- the mandatory entry of the ACL.furtherEntries
- additional entries of the ACL.- Returns:
- the new initialised Access Control List.
- Throws:
NullPointerException
- if any argument isnull
.
-
newAcl
@Deprecated public static AccessControlList newAcl(Iterable<AclEntry> entries)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutable Access Control List (ACL) which is initialised with the specified entries.- Parameters:
entries
- the entries of the ACL.- Returns:
- the new initialised Access Control List.
- Throws:
NullPointerException
- if any argument isnull
.
-
newAcl
@Deprecated public static AccessControlList newAcl(org.eclipse.ditto.json.JsonObject jsonObject)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutable Access Control List (ACL) based on the given JSON object.- Parameters:
jsonObject
- the JSON object representation of an ACL.- Returns:
- the new initialised
AccessControlList
. - Throws:
NullPointerException
- ifjsonObject
isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonObject
cannot be parsed toAccessControlList
.
-
newAcl
@Deprecated public static AccessControlList newAcl(String jsonString)
Deprecated.AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.Returns a new immutable Access Control List (ACL) based on the given JSON string.- Parameters:
jsonString
- the JSON object representation of an ACL.- Returns:
- the new initialised
AccessControlList
. - Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toAccessControlList
.
-
newThing
public static Thing newThing(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableThing
based on the given JSON object.- Parameters:
jsonObject
- the JSON object representation of a Thing.- Returns:
- the new Thing.
- Throws:
NullPointerException
- ifjsonObject
isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonObject
cannot be parsed toThing
.
-
newThing
public static Thing newThing(String jsonString)
Returns a new immutableThing
based on the given JSON string.- Parameters:
jsonString
- the JSON string representation of a Thing.- Returns:
- the new Thing.
- Throws:
NullPointerException
- ifjsonString
isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toThing
.
-
newThingBuilder
public static ThingBuilder.FromScratch newThingBuilder()
Returns a mutable builder with a fluent API for an immutableThing
from scratch.- Returns:
- the new builder.
-
newThingBuilder
public static ThingBuilder.FromCopy newThingBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a mutable builder with a fluent API for an immutableThing
based on the given JSON object. The JSON object is parsed in a fault tolerant way. I. e. all properties which cannot be deserialized are supposed to not exist.- Parameters:
jsonObject
- the JSON object representation of a Thing.- Returns:
- the new builder.
- Throws:
NullPointerException
- ifjsonObject
isnull
.org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonObject
cannot be parsed toThing
.
-
newThingBuilder
public static ThingBuilder.FromCopy newThingBuilder(String jsonString)
Returns a mutable builder with a fluent API for an immutableThing
based on the given JSON string. The JSON string is parsed in a fault tolerant way. I. e. all properties which cannot be deserialized are supposed to not exist.- Parameters:
jsonString
- string the JSON string representation of a Thing.- Returns:
- the new builder.
- Throws:
org.eclipse.ditto.model.base.exceptions.DittoJsonException
- ifjsonString
cannot be parsed toThing
.- See Also:
newThingBuilder(JsonObject)
-
newThingBuilder
public static ThingBuilder.FromCopy newThingBuilder(Thing thing)
Returns a mutable builder with a fluent API for an immutableThing
. The builder is initialised with the properties of the given Thing.- Parameters:
thing
- the Thing which provides the initial properties of the builder.- Returns:
- the new builder.
- Throws:
NullPointerException
- ifthing
isnull
.
-
-