Displaying and editing the complex value types for attributes.
[platform/upstream/iotivity.git] / service / simulator / java / sdk / src / org / oic / simulator / SimulatorResourceAttribute.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.oic.simulator;
18
19 /**
20  * This class represents the resource attribute which contains attribute value
21  * and its property.
22  */
23 public class SimulatorResourceAttribute {
24
25     private String            mName     = null;
26     private AttributeValue    mValue    = null;
27     private AttributeProperty mProperty = null;
28
29     /**
30      * Constructs {@SimulatorResourceAttribute}
31      * with attribute name, value and its property.
32      *
33      * @param name
34      *            Name of the attribute.
35      * @param value
36      *            Value of the attribute.
37      * @param property
38      *            Property of attribute value.
39      */
40     public SimulatorResourceAttribute(String name, AttributeValue value,
41             AttributeProperty property) {
42         mName = new String(name);
43         mValue = value;
44         mProperty = property;
45     }
46
47     /**
48      * Constructs {@SimulatorResourceAttribute}
49      * with attribute name, value.
50      *
51      * @param name
52      *            Name of the attribute.
53      * @param value
54      *            Value of the attribute.
55      */
56     public SimulatorResourceAttribute(String name, AttributeValue value) {
57         mName = new String(name);
58         mValue = value;
59         mProperty = null;
60     }
61
62     /**
63      * API to get name of attribute.
64      *
65      * @return Attribute's name.
66      */
67     public String name() {
68         return mName;
69     }
70
71     /**
72      * API to get value of attribute.
73      *
74      * @return Attribute's value {@AttributeValue}.
75      */
76     public AttributeValue value() {
77         return mValue;
78     }
79
80     /**
81      * API to get property of attribute's value.
82      *
83      * @return Attribute's value property {@AttributeProperty}.
84      */
85     public AttributeProperty property() {
86         return mProperty;
87     }
88
89     /**
90      * API to set the value of attribute.
91      *
92      * @param value
93      *            Value of the attribute.
94      */
95     public void setValue(AttributeValue value) {
96         this.mValue = value;
97     }
98
99     /**
100      * API to set the property of attribute.
101      *
102      * @param value
103      *            Property of the attribute.
104      */
105     public void setProperty(AttributeProperty property) {
106         this.mProperty = property;
107     }
108 }