class ChildTopicsModelImpl extends Object implements ChildTopicsModel
| Modifier and Type | Field and Description |
|---|---|
private Map<String,Object> |
childTopics
Internal representation.
|
private Logger |
logger |
private ModelFactory |
mf |
| Constructor and Description |
|---|
ChildTopicsModelImpl(ChildTopicsModelImpl childTopics) |
ChildTopicsModelImpl(Map<String,Object> childTopics,
ModelFactory mf) |
| Modifier and Type | Method and Description |
|---|---|
ChildTopicsModel |
add(String assocDefUri,
RelatedTopicModel value)
Adds a value to a multiple-valued child.
|
ChildTopicsModel |
add(String assocDefUri,
TopicModel value) |
ChildTopicsModel |
addDeletionRef(String assocDefUri,
long refTopicId)
Adds a by-ID topic deletion reference to a multiple-valued child.
|
ChildTopicsModel |
addDeletionRef(String assocDefUri,
String refTopicUri)
Adds a by-URI topic deletion reference to a multiple-valued child.
|
ChildTopicsModel |
addRef(String assocDefUri,
long refTopicId)
Adds a by-ID topic reference to a multiple-valued child.
|
ChildTopicsModel |
addRef(String assocDefUri,
String refTopicUri)
Adds a by-URI topic reference to a multiple-valued child.
|
(package private) void |
addToChildTopics(RelatedTopicModel childTopic,
AssociationDefinitionModel assocDef)
For multiple-valued childs
|
ChildTopicsModel |
clone() |
(package private) RelatedTopicModelImpl |
findChildTopicById(long childTopicId,
AssociationDefinitionModel assocDef)
For multiple-valued childs: looks in the attached object cache for a child topic by ID.
|
(package private) RelatedTopicModelImpl |
findChildTopicByRef(TopicReferenceModelImpl topicRef,
AssociationDefinitionModel assocDef)
For multiple-valued childs: looks in the attached object cache for the child topic the given reference refers to.
|
Object |
get(String assocDefUri)
Accesses a child generically, regardless of single-valued or multiple-valued.
|
boolean |
getBoolean(String assocDefUri)
Convenience accessor for the *simple* value of a single-valued child.
|
boolean |
getBoolean(String assocDefUri,
boolean defaultValue)
Convenience accessor for the *simple* value of a single-valued child.
|
ChildTopicsModel |
getChildTopicsModel(String assocDefUri)
Convenience accessor for the *composite* value of a single-valued child.
|
ChildTopicsModel |
getChildTopicsModel(String assocDefUri,
ChildTopicsModel defaultValue)
Convenience accessor for the *composite* value of a single-valued child.
|
double |
getDouble(String assocDefUri)
Convenience accessor for the *simple* value of a single-valued child.
|
double |
getDouble(String assocDefUri,
double defaultValue)
Convenience accessor for the *simple* value of a single-valued child.
|
int |
getInt(String assocDefUri)
Convenience accessor for the *simple* value of a single-valued child.
|
int |
getInt(String assocDefUri,
int defaultValue)
Convenience accessor for the *simple* value of a single-valued child.
|
long |
getLong(String assocDefUri)
Convenience accessor for the *simple* value of a single-valued child.
|
long |
getLong(String assocDefUri,
long defaultValue)
Convenience accessor for the *simple* value of a single-valued child.
|
Object |
getObject(String assocDefUri)
Convenience accessor for the *simple* value of a single-valued child.
|
Object |
getObject(String assocDefUri,
Object defaultValue)
Convenience accessor for the *simple* value of a single-valued child.
|
String |
getString(String assocDefUri)
Convenience accessor for the *simple* value of a single-valued child.
|
String |
getString(String assocDefUri,
String defaultValue)
Convenience accessor for the *simple* value of a single-valued child.
|
RelatedTopicModelImpl |
getTopic(String assocDefUri)
Accesses a single-valued child.
|
RelatedTopicModelImpl |
getTopicOrNull(String assocDefUri)
Accesses a single-valued child.
|
List<RelatedTopicModelImpl> |
getTopics(String assocDefUri)
Accesses a multiple-valued child.
|
List<RelatedTopicModelImpl> |
getTopicsOrNull(String assocDefUri)
Accesses a multiple-valued child.
|
(package private) boolean |
has(String assocDefUri)
Checks if a child is contained in this ChildTopicsModel.
|
Iterator<String> |
iterator()
Returns an interator which iterates this ChildTopicsModel's assoc def URIs.
|
ChildTopicsModel |
put(String assocDefUri,
ChildTopicsModel value)
Convenience method to put a *composite* value in a single-valued child.
|
ChildTopicsModel |
put(String assocDefUri,
List<RelatedTopicModel> values)
Sets the values of a multiple-valued child.
|
ChildTopicsModel |
put(String assocDefUri,
Object value)
Convenience method to put a *simple* value in a single-valued child.
|
ChildTopicsModel |
put(String assocDefUri,
RelatedTopicModel value)
Puts a value in a single-valued child.
|
ChildTopicsModel |
put(String assocDefUri,
TopicModel value) |
ChildTopicsModel |
putDeletionRef(String assocDefUri,
long refTopicId)
Puts a by-ID topic deletion reference to a single-valued child.
|
ChildTopicsModel |
putDeletionRef(String assocDefUri,
String refTopicUri)
Puts a by-URI topic deletion reference to a single-valued child.
|
(package private) void |
putInChildTopics(RelatedTopicModel childTopic,
AssociationDefinitionModel assocDef)
For single-valued childs
|
ChildTopicsModel |
putRef(String assocDefUri,
long refTopicId)
Puts a by-ID topic reference in a single-valued child.
|
ChildTopicsModel |
putRef(String assocDefUri,
String refTopicUri)
Puts a by-URI topic reference in a single-valued child.
|
ChildTopicsModel |
remove(String assocDefUri)
Removes a single-valued child.
|
ChildTopicsModel |
remove(String assocDefUri,
TopicModel value)
Removes a value from a multiple-valued child.
|
(package private) void |
removeChildTopic(AssociationDefinitionModel assocDef)
For single-valued childs
|
(package private) void |
removeFromChildTopics(RelatedTopicModel childTopic,
AssociationDefinitionModel assocDef)
For multiple-valued childs
|
(package private) int |
size()
Returns the number of childs contained in this ChildTopicsModel.
|
private void |
throwInvalidMultiAccess(String assocDefUri,
ClassCastException e) |
private void |
throwInvalidSingleAccess(String assocDefUri,
ClassCastException e) |
org.codehaus.jettison.json.JSONObject |
toJSON() |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprivate Map<String,Object> childTopics
private ModelFactory mf
ChildTopicsModelImpl(Map<String,Object> childTopics, ModelFactory mf)
ChildTopicsModelImpl(ChildTopicsModelImpl childTopics)
public final RelatedTopicModelImpl getTopic(String assocDefUri)
ChildTopicsModelgetTopic in interface ChildTopicsModelpublic final RelatedTopicModelImpl getTopicOrNull(String assocDefUri)
ChildTopicsModelnull if there is no such child.getTopicOrNull in interface ChildTopicsModelpublic final List<RelatedTopicModelImpl> getTopics(String assocDefUri)
ChildTopicsModelgetTopics in interface ChildTopicsModelpublic final List<RelatedTopicModelImpl> getTopicsOrNull(String assocDefUri)
ChildTopicsModelnull if there is no such child.
### TODO: drop this methodgetTopicsOrNull in interface ChildTopicsModelpublic final Object get(String assocDefUri)
get in interface ChildTopicsModelpublic final String getString(String assocDefUri)
getString in interface ChildTopicsModelpublic final String getString(String assocDefUri, String defaultValue)
getString in interface ChildTopicsModelpublic final int getInt(String assocDefUri)
getInt in interface ChildTopicsModelpublic final int getInt(String assocDefUri, int defaultValue)
getInt in interface ChildTopicsModelpublic final long getLong(String assocDefUri)
getLong in interface ChildTopicsModelpublic final long getLong(String assocDefUri, long defaultValue)
getLong in interface ChildTopicsModelpublic final double getDouble(String assocDefUri)
getDouble in interface ChildTopicsModelpublic final double getDouble(String assocDefUri, double defaultValue)
getDouble in interface ChildTopicsModelpublic final boolean getBoolean(String assocDefUri)
getBoolean in interface ChildTopicsModelpublic final boolean getBoolean(String assocDefUri, boolean defaultValue)
getBoolean in interface ChildTopicsModelpublic final Object getObject(String assocDefUri)
getObject in interface ChildTopicsModelpublic final Object getObject(String assocDefUri, Object defaultValue)
getObject in interface ChildTopicsModelpublic final ChildTopicsModel getChildTopicsModel(String assocDefUri)
getChildTopicsModel in interface ChildTopicsModelpublic final ChildTopicsModel getChildTopicsModel(String assocDefUri, ChildTopicsModel defaultValue)
getChildTopicsModel in interface ChildTopicsModelpublic final ChildTopicsModel put(String assocDefUri, RelatedTopicModel value)
put in interface ChildTopicsModelpublic final ChildTopicsModel put(String assocDefUri, TopicModel value)
put in interface ChildTopicsModelpublic final ChildTopicsModel put(String assocDefUri, Object value)
put in interface ChildTopicsModelvalue - a String, Integer, Long, Double, or a Boolean.public final ChildTopicsModel put(String assocDefUri, ChildTopicsModel value)
put in interface ChildTopicsModelpublic final ChildTopicsModel putRef(String assocDefUri, long refTopicId)
putRef in interface ChildTopicsModelpublic final ChildTopicsModel putRef(String assocDefUri, String refTopicUri)
putRef in interface ChildTopicsModelpublic final ChildTopicsModel putDeletionRef(String assocDefUri, long refTopicId)
putDeletionRef in interface ChildTopicsModelpublic final ChildTopicsModel putDeletionRef(String assocDefUri, String refTopicUri)
putDeletionRef in interface ChildTopicsModelpublic final ChildTopicsModel remove(String assocDefUri)
remove in interface ChildTopicsModelpublic final ChildTopicsModel add(String assocDefUri, RelatedTopicModel value)
add in interface ChildTopicsModelpublic final ChildTopicsModel add(String assocDefUri, TopicModel value)
add in interface ChildTopicsModelpublic final ChildTopicsModel put(String assocDefUri, List<RelatedTopicModel> values)
put in interface ChildTopicsModelpublic final ChildTopicsModel remove(String assocDefUri, TopicModel value)
remove in interface ChildTopicsModelpublic final ChildTopicsModel addRef(String assocDefUri, long refTopicId)
addRef in interface ChildTopicsModelpublic final ChildTopicsModel addRef(String assocDefUri, String refTopicUri)
addRef in interface ChildTopicsModelpublic final ChildTopicsModel addDeletionRef(String assocDefUri, long refTopicId)
addDeletionRef in interface ChildTopicsModelpublic final ChildTopicsModel addDeletionRef(String assocDefUri, String refTopicUri)
addDeletionRef in interface ChildTopicsModelpublic final Iterator<String> iterator()
public final org.codehaus.jettison.json.JSONObject toJSON()
toJSON in interface JSONEnabledpublic final ChildTopicsModel clone()
clone in interface ChildTopicsModelclone in class ObjectRelatedTopicModelImpl findChildTopicById(long childTopicId, AssociationDefinitionModel assocDef)
RelatedTopicModelImpl findChildTopicByRef(TopicReferenceModelImpl topicRef, AssociationDefinitionModel assocDef)
assocDef - the child topics according to this association definition are considered.int size()
void putInChildTopics(RelatedTopicModel childTopic, AssociationDefinitionModel assocDef)
void removeChildTopic(AssociationDefinitionModel assocDef)
void addToChildTopics(RelatedTopicModel childTopic, AssociationDefinitionModel assocDef)
void removeFromChildTopics(RelatedTopicModel childTopic, AssociationDefinitionModel assocDef)
private void throwInvalidSingleAccess(String assocDefUri, ClassCastException e)
private void throwInvalidMultiAccess(String assocDefUri, ClassCastException e)
Copyright © 2018. All Rights Reserved.