dd308f10446b74a73c379189ad796689e94990ca
[platform/upstream/iotivity.git] / service / resource-container / android / resource-container / src / main / java / org / iotivity / service / resourcecontainer / ResourceConfig.java
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 package org.iotivity.service.resourcecontainer;
22
23 /**
24  * This class holds the configuration parameters for a single resource instance provided
25  * by the resource bundle.
26  */
27 public class ResourceConfig {
28     private String m_name, m_uri, m_resourceType, m_address;
29
30     /**
31      * Empty constructor for resoure config.
32      */
33     public ResourceConfig() {
34
35     }
36
37     /**
38      * Creates a new resource config instance.
39      * @param params Resource parameters as array. 1. Name, 2. URI, 3. Resource Type, 4. Address 
40      */
41     public ResourceConfig(String[] params) {
42         m_name = params[0];
43         m_uri = params[1];
44         m_resourceType = params[2];
45         m_address = params[3];
46     }
47
48     /**
49      * Returns the configured name
50      * @return name property
51      */
52     public String getName() {
53         return m_name;
54     }
55
56     /**
57      * Sets the name
58      * @param m_name Resource name
59      */
60     public void setName(String m_name) {
61         this.m_name = m_name;
62     }
63
64     /**
65      * Returns the configured URI
66      * @return Configured URI
67      */
68     public String getURI() {
69         return m_uri;
70     }
71
72     /**
73      * Sets the configured URI
74      * @param m_uri Configuration URI
75      */
76     public void setURI(String m_uri) {
77         this.m_uri = m_uri;
78     }
79
80     /**
81      * Returns the configured resource type
82      * @return configured resource type
83      */
84     public String getResourceType() {
85         return m_resourceType;
86     }
87
88     /**
89      * Sets the configured resource type
90      * @param m_resourceType updates the configured resource type
91      */
92     public void setResourceType(String m_resourceType) {
93         this.m_resourceType = m_resourceType;
94     }
95
96     /**
97      * Returns the configured address
98      * @return Configured address
99      */
100     public String getAddress() {
101         return m_address;
102     }
103
104     /**
105      * Sets the configured address
106      * @param m_address Configured address
107      */
108     public void setAddress(String m_address) {
109         this.m_address = m_address;
110     }
111
112     @Override
113     public String toString() {
114         return "ResourceConfig [m_name=" + m_name + ", m_uri=" + m_uri
115                 + ", m_resourceType=" + m_resourceType + ", m_address="
116                 + m_address + "]";
117     }
118
119 }