import java.util.Map;
/**
- * This class represents the resource model of a resource.
+ * This class represents the resource model of a resource. A resource model
+ * contains a set of attributes and their properties. It represents the complex
+ * value type of an attribute.
*/
public class SimulatorResourceModel {
private Map<String, AttributeProperty> mProperties = null;
/**
- * Constructs new {@SimulatorResourceModel} object.
+ * Constructs new {@link SimulatorResourceModel} object.
*/
public SimulatorResourceModel() {
mValues = new HashMap<>();
* API to add an attribute to resource model.
*
* @param attribute
- * {@link SimulatorResourceAttribute} to be add to resource
+ * {@link SimulatorResourceAttribute} to be added to resource
* model.
*
* @throws InvalidArgsException
* corresponding {@link SimulatorResourceAttribute} as value.
*/
public Map<String, SimulatorResourceAttribute> getAttributes() {
- if (mValues.size() == 0)
- return null;
-
Map<String, SimulatorResourceAttribute> attributes = new HashMap<>();
for (Map.Entry<String, AttributeValue> entry : mValues.entrySet()) {
SimulatorResourceAttribute attribute = new SimulatorResourceAttribute(
}
/**
- * API to check whether resource model has attribute.
+ * API to check whether resource model has an attribute with given name.
*
* @param attrName
* Name of the attribute.
* @param attrName
* Name of the attribute.
*
- * @return Attribute value type information {@AttributeValue.TypeInfo}.
+ * @return Attribute value type information {@link AttributeValue.TypeInfo
+ *
+ * }.
*/
public AttributeValue.TypeInfo getAttributeType(String attrName) {
if (mValues.containsKey(attrName))
* @param attrName
* Name of the attribute.
*
- * @return true if resource model has attribute it is removed, otherwise
- * false.
+ * @return true if resource model has an attribute with the given name,
+ * otherwise false.
*/
public boolean removeAttribute(String attrName) {
if (mValues.containsKey(attrName)) {
/**
* API to update the attribute values from given
* {@link SimulatorResourceModel}.
+ *
+ * @param resourceModel
+ * {@link SimulatorResourceModel} holding the new attribute
+ * values.
*/
public void update(SimulatorResourceModel resourceModel) {
if (null == resourceModel || 0 == resourceModel.size())
}
}
- // Methods used in native code
private SimulatorResourceModel(Map<String, AttributeValue> values,
Map<String, AttributeProperty> properties) {
mValues = values;