Interface ChildTopicsModel

    • Method Detail

      • getTopic

        RelatedTopicModel getTopic​(String compDefUri)
        Accesses a single-valued child. Throws if there is no such child.
      • getTopicOrNull

        RelatedTopicModel getTopicOrNull​(String compDefUri)
        Accesses a single-valued child. Returns null if there is no such child.
      • getTopics

        List<? extends RelatedTopicModel> getTopics​(String compDefUri)
        Accesses a multiple-valued child. Throws if there is no such child. ### TODO: explain why not return an empty list instead
      • getTopicsOrNull

        List<? extends RelatedTopicModel> getTopicsOrNull​(String compDefUri)
        Accesses a multiple-valued child. Returns null if there is no such child. ### TODO: explain why not return an empty list instead
      • get

        Object get​(String compDefUri)
        Accesses a child generically, regardless of single-valued or multiple-valued. Returns null if there is no such child.
        Returns:
        A RelatedTopicModel or List, or null if there is no such child.
      • has

        boolean has​(String compDefUri)
        Checks if a child is contained in this ChildTopicsModel.
      • size

        int size()
        Returns the number of children contained in this ChildTopicsModel. Multiple-valued children count as one.
      • getString

        String getString​(String compDefUri)
        Convenience accessor for the *simple* value of a single-valued child. Throws if the child doesn't exist.
      • getString

        String getString​(String compDefUri,
                         String defaultValue)
        Convenience accessor for the *simple* value of a single-valued child. Returns a default value if the child doesn't exist.
      • getInt

        int getInt​(String compDefUri)
        Convenience accessor for the *simple* value of a single-valued child. Throws if the child doesn't exist.
      • getInt

        int getInt​(String compDefUri,
                   int defaultValue)
        Convenience accessor for the *simple* value of a single-valued child. Returns a default value if the child doesn't exist.
      • getLong

        long getLong​(String compDefUri)
        Convenience accessor for the *simple* value of a single-valued child. Throws if the child doesn't exist.
      • getLong

        long getLong​(String compDefUri,
                     long defaultValue)
        Convenience accessor for the *simple* value of a single-valued child. Returns a default value if the child doesn't exist.
      • getDouble

        double getDouble​(String compDefUri)
        Convenience accessor for the *simple* value of a single-valued child. Throws if the child doesn't exist.
      • getDouble

        double getDouble​(String compDefUri,
                         double defaultValue)
        Convenience accessor for the *simple* value of a single-valued child. Returns a default value if the child doesn't exist.
      • getBoolean

        boolean getBoolean​(String compDefUri)
        Convenience accessor for the *simple* value of a single-valued child. Throws if the child doesn't exist.
      • getBoolean

        boolean getBoolean​(String compDefUri,
                           boolean defaultValue)
        Convenience accessor for the *simple* value of a single-valued child. Returns a default value if the child doesn't exist.
      • getValue

        Object getValue​(String compDefUri)
        Convenience accessor for the *simple* value of a single-valued child. Throws if the child doesn't exist.
        Returns:
        String, Integer, Long, Double, or Boolean. Never null.
      • getValue

        Object getValue​(String compDefUri,
                        Object defaultValue)
        Convenience accessor for the *simple* value of a single-valued child. Returns a default value if the child doesn't exist.
        Returns:
        String, Integer, Long, Double, or Boolean. Never null.
      • getChildTopics

        ChildTopicsModel getChildTopics​(String compDefUri)
        Convenience accessor for the *composite* value of a single-valued child. Throws if the child doesn't exist.
      • getChildTopics

        ChildTopicsModel getChildTopics​(String compDefUri,
                                        ChildTopicsModel defaultValue)
        Convenience accessor for the *composite* value of a single-valued child. Returns a default value if the child doesn't exist.
      • set

        ChildTopicsModel set​(String compDefUri,
                             Object value)
        Convenience method to put a *simple* value in a single-valued child. An existing value is overwritten.
        Parameters:
        value - the simple value: a String, Integer, Long, Double, or a Boolean. Primitive values are auto-boxed.
        Returns:
        this ChildTopicsModel.
      • set

        ChildTopicsModel set​(String compDefUri,
                             ChildTopicsModel value)
        Convenience method to put a *composite* value in a single-valued child. An existing value is overwritten.
        Returns:
        this ChildTopicsModel.
      • setRef

        ChildTopicsModel setRef​(String compDefUri,
                                long refTopicId)
        Puts a by-ID topic reference in a single-valued child. An existing reference is overwritten.
      • setRef

        ChildTopicsModel setRef​(String compDefUri,
                                String refTopicUri)
        Puts a by-URI topic reference in a single-valued child. An existing reference is overwritten.
      • setRef

        ChildTopicsModel setRef​(String compDefUri,
                                long refTopicId,
                                AssocModel assoc)
        Puts a by-ID topic reference in a single-valued child. An existing reference is overwritten.
        Parameters:
        assoc - provides a value (simple or composite) for the created relating association.
      • setRef

        ChildTopicsModel setRef​(String compDefUri,
                                String refTopicUri,
                                AssocModel assoc)
        Puts a by-URI topic reference in a single-valued child. An existing reference is overwritten.
        Parameters:
        assoc - provides a value (simple or composite) for the created relating association.
      • setDeletionRef

        ChildTopicsModel setDeletionRef​(String compDefUri,
                                        long refTopicId)
        Puts a by-ID topic deletion reference in a single-valued child. An existing value is overwritten.
      • setDeletionRef

        ChildTopicsModel setDeletionRef​(String compDefUri,
                                        String refTopicUri)
        Puts a by-URI topic deletion reference in a single-valued child. An existing value is overwritten.
      • add

        ChildTopicsModel add​(String compDefUri,
                             Object value)
        Convenience method to add a *simple* value to a multiple-valued child.
        Parameters:
        value - the simple value: a String, Integer, Long, Double, or a Boolean. Primitive values are auto-boxed.
        Returns:
        this ChildTopicsModel.
      • addRef

        ChildTopicsModel addRef​(String compDefUri,
                                long refTopicId)
        Adds a by-ID topic reference to a multiple-valued child.
      • addRef

        ChildTopicsModel addRef​(String compDefUri,
                                long refTopicId,
                                AssocModel assoc)
        Adds a by-ID topic reference to a multiple-valued child.
        Parameters:
        assoc - provides a value (simple or composite) for the created relating association.
      • addRef

        ChildTopicsModel addRef​(String compDefUri,
                                String refTopicUri,
                                AssocModel assoc)
        Adds a by-URI topic reference to a multiple-valued child.
        Parameters:
        assoc - provides a value (simple or composite) for the created relating association.
      • addDeletionRef

        ChildTopicsModel addDeletionRef​(String compDefUri,
                                        long assocId)
        Adds a topic deletion reference to a multiple-valued child. Note: the topic to be deleted is referred to by association ID. The topic might occur several times in the same multi-value, so topic ID/URI would not be unique.
        Parameters:
        assocId - ID of the association that connects the to be deleted topic with the parent.