e0d0879958e4f1e049c7283147d3d4bd32c9fc09
[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      * Creates a new resource config instance.
38      * @param params Resource parameters as array. 1. Name, 2. URI, 3. Resource Type, 4. Address 
39      */
40     public ResourceConfig(String[] params) {
41         m_name = params[0];
42         m_uri = params[1];
43         m_resourceType = params[2];
44         m_address = params[3];
45     }
46
47     /**
48      * Returns the configured name
49      * @return name property
50      */
51     public String getName() {
52         return m_name;
53     }
54
55     /**
56      * Sets the name
57      * @param m_name Resource name
58      */
59     public void setName(String m_name) {
60         this.m_name = m_name;
61     }
62
63     /**
64      * Returns the configured URI
65      * @return Configured URI
66      */
67     public String getURI() {
68         return m_uri;
69     }
70
71     /**
72      * Sets the configured URI
73      * @param m_uri Configuration URI
74      */
75     public void setURI(String m_uri) {
76         this.m_uri = m_uri;
77     }
78
79     /**
80      * Returns the configured resource type
81      * @return configured resource type
82      */
83     public String getResourceType() {
84         return m_resourceType;
85     }
86
87     /**
88      * Sets the configured resource type
89      * @param m_resourceType updates the configured resource type
90      */
91     public void setResourceType(String m_resourceType) {
92         this.m_resourceType = m_resourceType;
93     }
94
95     /**
96      * Returns the configured address
97      * @return Configured address
98      */
99     public String getAddress() {
100         return m_address;
101     }
102
103     /**
104      * Sets the configured address
105      * @param m_address Configured address
106      */
107     public void setAddress(String m_address) {
108         this.m_address = m_address;
109     }
110
111     @Override
112     public String toString() {
113         return "ResourceConfig [m_name=" + m_name + ", m_uri=" + m_uri
114                 + ", m_resourceType=" + m_resourceType + ", m_address="
115                 + m_address + "]";
116     }
117
118 }