2 * Copyright 2015 Samsung Electronics All Rights Reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package oic.simulator.clientcontroller.remoteresource;
19 import java.util.List;
22 * This is a helper class for showing the resource attributes in PUT and POST
25 public class PutPostAttributeModel {
27 private String attName;
28 private String attValue;
29 private List<String> values;
32 public String getAttName() {
36 public void setAttName(String attName) {
37 this.attName = attName;
40 public String getAttValue() {
44 public void setAttValue(String attValue) {
45 this.attValue = attValue;
48 public List<String> getValues() {
52 public void setValues(List<String> values) {
56 public boolean isModified() {
60 public void setModified(boolean modified) {
61 this.modified = modified;
64 public static PutPostAttributeModel getModel(
65 RemoteResourceAttribute attribute) {
66 PutPostAttributeModel putPostModel = null;
67 if (null != attribute) {
68 putPostModel = new PutPostAttributeModel();
69 putPostModel.setAttName(attribute.getAttributeName());
70 putPostModel.setAttValue(String.valueOf(attribute
71 .getAttributeValue()));
72 putPostModel.setValues(attribute.getAllValues());
73 putPostModel.setModified(false);
79 public String toString() {
80 return attName + "," + attValue + "\n";