Imported Upstream version 1.1.0
[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 {@link SimulatorResourceAttribute} with the given attribute
31      * 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 = name;
43         mValue = value;
44         mProperty = property;
45     }
46
47     /**
48      * Constructs {@link SimulatorResourceAttribute} with the given attribute
49      * name and 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 = 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 {@link 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 {@link AttributeProperty
84      * }.
85      */
86     public AttributeProperty property() {
87         return mProperty;
88     }
89
90     /**
91      * API to set the name of attribute.
92      *
93      * @param name
94      *            Name of the attribute.
95      */
96     public void setName(String name) {
97         this.mName = name;
98     }
99
100     /**
101      * API to set the value of attribute.
102      *
103      * @param value
104      *            Value of the attribute.
105      */
106     public void setValue(AttributeValue value) {
107         this.mValue = value;
108     }
109
110     /**
111      * API to set the property of attribute.
112      *
113      * @param property
114      *            Property of the attribute.
115      */
116     public void setProperty(AttributeProperty property) {
117         this.mProperty = property;
118     }
119 }