Interface FeatureDefinition

  • All Superinterfaces:
    java.lang.Iterable<DefinitionIdentifier>, org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonArray>

    @Immutable
    public interface FeatureDefinition
    extends java.lang.Iterable<DefinitionIdentifier>, org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonArray>
    A FeatureDefinition is a list of fully qualified DefinitionIdentifiers. A FeatureDefinition is guaranteed to contain at least one DefinitionIdentifier. Each Identifier is unique, i. e. a Feature Definition does not contain duplicates.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable

        org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends java.lang.Object>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,​T extends java.lang.Object>
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static FeatureDefinition fromIdentifier​(java.lang.CharSequence identifier, java.lang.CharSequence... furtherIdentifiers)
      Parses the specified CharSequence to an Identifier and returns an immutable FeatureDefinition containing that Identifier.
      static FeatureDefinition fromJson​(java.lang.String jsonArrayAsString)
      Returns a new immutable FeatureDefinition which is initialised with the values of the given JSON string.
      static FeatureDefinition fromJson​(org.eclipse.ditto.json.JsonArray jsonArray)
      Returns a new immutable FeatureDefinition which is initialised with the values of the given JSON array.
      DefinitionIdentifier getFirstIdentifier()
      Returns the first Identifier of this Feature Definition which is guaranteed to exist.
      int getSize()
      Returns the count of Identifiers of this Feature Definition.
      java.util.stream.Stream<DefinitionIdentifier> stream()
      Returns a sequential Stream with the Identifiers of this Feature Definition as its source.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
      • Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable

        getImplementedSchemaVersion, getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJson, toJsonString
    • Method Detail

      • fromIdentifier

        static FeatureDefinition fromIdentifier​(java.lang.CharSequence identifier,
                                                java.lang.CharSequence... furtherIdentifiers)
        Parses the specified CharSequence to an Identifier and returns an immutable FeatureDefinition containing that Identifier.
        Parameters:
        identifier - CharSequence-representation of the first Identifier of the returned FeatureDefinition.
        furtherIdentifiers - optional further Identifiers of the returned FeatureDefinition.
        Returns:
        the instance.
        Throws:
        java.lang.NullPointerException - if any argument is null.
        DefinitionIdentifierInvalidException - if any argument is invalid.
      • fromJson

        static FeatureDefinition fromJson​(java.lang.String jsonArrayAsString)
        Returns a new immutable FeatureDefinition which is initialised with the values of the given JSON string. This string is required to be a valid JsonArray.
        Parameters:
        jsonArrayAsString - provides the initial values of the result.
        Returns:
        the new immutable initialised FeatureDefinition.
        Throws:
        java.lang.NullPointerException - if jsonArrayAsString is null.
        org.eclipse.ditto.base.model.exceptions.DittoJsonException - if jsonArrayAsString cannot be parsed to FeatureDefinition.
        FeatureDefinitionEmptyException - if the JSON array is empty.
        DefinitionIdentifierInvalidException - if any Identifier of the JSON array is invalid.
      • fromJson

        static FeatureDefinition fromJson​(org.eclipse.ditto.json.JsonArray jsonArray)
        Returns a new immutable FeatureDefinition which is initialised with the values of the given JSON array.
        Parameters:
        jsonArray - provides the initial values of the result.
        Returns:
        the new immutable initialised FeatureDefinition.
        Throws:
        java.lang.NullPointerException - if jsonArray is null.
        java.lang.IllegalArgumentException - if jsonArray is empty.
        DefinitionIdentifierInvalidException - if any Identifier of jsonArray is invalid.
      • getFirstIdentifier

        DefinitionIdentifier getFirstIdentifier()
        Returns the first Identifier of this Feature Definition which is guaranteed to exist.
        Returns:
        the Identifier.
      • getSize

        int getSize()
        Returns the count of Identifiers of this Feature Definition. The size is guaranteed to be at least one.
        Returns:
        the size.
      • stream

        java.util.stream.Stream<DefinitionIdentifier> stream()
        Returns a sequential Stream with the Identifiers of this Feature Definition as its source.
        Returns:
        a sequential stream of the Identifiers of this Feature Definition.