Package systems.dmx.core.model
Interface ChildTopicsModel
-
- All Superinterfaces:
Iterable<String>
,JSONEnabled
- All Known Subinterfaces:
FacetValueModel
public interface ChildTopicsModel extends JSONEnabled, Iterable<String>
The data that underly aChildTopics
object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChildTopicsModel
add(String compDefUri, Object value)
Convenience method to add a *simple* value to a multiple-valued child.ChildTopicsModel
add(String compDefUri, ChildTopicsModel value)
Convenience method to add a *composite* value to a multiple-valued child.ChildTopicsModel
add(String compDefUri, RelatedTopicModel value)
Adds a value to a multiple-valued child.ChildTopicsModel
add(String compDefUri, TopicModel value)
ChildTopicsModel
addDeletionRef(String compDefUri, long assocId)
Adds a topic deletion reference to a multiple-valued child.ChildTopicsModel
addRef(String compDefUri, long refTopicId)
Adds a by-ID topic reference to a multiple-valued child.ChildTopicsModel
addRef(String compDefUri, long refTopicId, AssocModel assoc)
Adds a by-ID topic reference to a multiple-valued child.ChildTopicsModel
addRef(String compDefUri, String refTopicUri)
Adds a by-URI topic reference to a multiple-valued child.ChildTopicsModel
addRef(String compDefUri, String refTopicUri, AssocModel assoc)
Adds a by-URI topic reference to a multiple-valued child.ChildTopicsModel
clone()
Object
get(String compDefUri)
Accesses a child generically, regardless of single-valued or multiple-valued.boolean
getBoolean(String compDefUri)
Convenience accessor for the *simple* value of a single-valued child.boolean
getBoolean(String compDefUri, boolean defaultValue)
Convenience accessor for the *simple* value of a single-valued child.ChildTopicsModel
getChildTopics(String compDefUri)
Convenience accessor for the *composite* value of a single-valued child.ChildTopicsModel
getChildTopics(String compDefUri, ChildTopicsModel defaultValue)
Convenience accessor for the *composite* value of a single-valued child.double
getDouble(String compDefUri)
Convenience accessor for the *simple* value of a single-valued child.double
getDouble(String compDefUri, double defaultValue)
Convenience accessor for the *simple* value of a single-valued child.int
getInt(String compDefUri)
Convenience accessor for the *simple* value of a single-valued child.int
getInt(String compDefUri, int defaultValue)
Convenience accessor for the *simple* value of a single-valued child.long
getLong(String compDefUri)
Convenience accessor for the *simple* value of a single-valued child.long
getLong(String compDefUri, long defaultValue)
Convenience accessor for the *simple* value of a single-valued child.String
getString(String compDefUri)
Convenience accessor for the *simple* value of a single-valued child.String
getString(String compDefUri, String defaultValue)
Convenience accessor for the *simple* value of a single-valued child.RelatedTopicModel
getTopic(String compDefUri)
Accesses a single-valued child.RelatedTopicModel
getTopicOrNull(String compDefUri)
Accesses a single-valued child.List<? extends RelatedTopicModel>
getTopics(String compDefUri)
Accesses a multiple-valued child.List<? extends RelatedTopicModel>
getTopicsOrNull(String compDefUri)
Accesses a multiple-valued child.Object
getValue(String compDefUri)
Convenience accessor for the *simple* value of a single-valued child.Object
getValue(String compDefUri, Object defaultValue)
Convenience accessor for the *simple* value of a single-valued child.boolean
has(String compDefUri)
Checks if a child is contained in this ChildTopicsModel.ChildTopicsModel
remove(String compDefUri)
Removes a single-valued child.ChildTopicsModel
remove(String compDefUri, TopicModel value)
Removes a value from a multiple-valued child.ChildTopicsModel
set(String compDefUri, Object value)
Convenience method to put a *simple* value in a single-valued child.ChildTopicsModel
set(String compDefUri, List<RelatedTopicModel> values)
Sets the values of a multiple-valued child.ChildTopicsModel
set(String compDefUri, ChildTopicsModel value)
Convenience method to put a *composite* value in a single-valued child.ChildTopicsModel
set(String compDefUri, RelatedTopicModel value)
Puts a value in a single-valued child.ChildTopicsModel
set(String compDefUri, TopicModel value)
ChildTopicsModel
setDeletionRef(String compDefUri, long refTopicId)
Puts a by-ID topic deletion reference in a single-valued child.ChildTopicsModel
setDeletionRef(String compDefUri, String refTopicUri)
Puts a by-URI topic deletion reference in a single-valued child.ChildTopicsModel
setRef(String compDefUri, long refTopicId)
Puts a by-ID topic reference in a single-valued child.ChildTopicsModel
setRef(String compDefUri, long refTopicId, AssocModel assoc)
Puts a by-ID topic reference in a single-valued child.ChildTopicsModel
setRef(String compDefUri, String refTopicUri)
Puts a by-URI topic reference in a single-valued child.ChildTopicsModel
setRef(String compDefUri, String refTopicUri, AssocModel assoc)
Puts a by-URI topic reference in a single-valued child.int
size()
Returns the number of children contained in this ChildTopicsModel.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface systems.dmx.core.JSONEnabled
dump, toJSON
-
-
-
-
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. Returnsnull
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. Returnsnull
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, RelatedTopicModel value)
Puts a value in a single-valued child. An existing value is overwritten.
-
set
ChildTopicsModel set(String compDefUri, TopicModel value)
-
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.
-
remove
ChildTopicsModel remove(String compDefUri)
Removes a single-valued child.
-
add
ChildTopicsModel add(String compDefUri, RelatedTopicModel value)
Adds a value to a multiple-valued child.
-
add
ChildTopicsModel add(String compDefUri, TopicModel value)
-
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.
-
add
ChildTopicsModel add(String compDefUri, ChildTopicsModel value)
Convenience method to add a *composite* value to a multiple-valued child.- Returns:
- this ChildTopicsModel.
-
set
ChildTopicsModel set(String compDefUri, List<RelatedTopicModel> values)
Sets the values of a multiple-valued child. Existing values are overwritten.
-
remove
ChildTopicsModel remove(String compDefUri, TopicModel value)
Removes a value from a multiple-valued child.
-
addRef
ChildTopicsModel addRef(String compDefUri, long refTopicId)
Adds a by-ID topic reference to a multiple-valued child.
-
addRef
ChildTopicsModel addRef(String compDefUri, String refTopicUri)
Adds a by-URI 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.
-
clone
ChildTopicsModel clone()
-
-