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.utils;
19 import java.util.ArrayList;
20 import java.util.Iterator;
21 import java.util.List;
25 * This class has common utility methods.
27 public class Utility {
28 public static List<String> convertSetToList(Set<String> typeSet) {
29 if (null == typeSet) {
32 List<String> list = new ArrayList<String>();
33 Iterator<String> typeItr = typeSet.iterator();
34 while (typeItr.hasNext()) {
35 list.add(typeItr.next());
40 public static String getObservableInString(boolean observable) {
48 public static String[] convertListToString(List<String> valueList) {
50 if (null != valueList && valueList.size() > 0) {
51 strArr = valueList.toArray(new String[1]);
53 strArr = new String[1];
59 * public static List<Object> converArrayToList(int[] arr) { if(null == arr
60 * || arr.length < 1) { return null; } List<Object> valueList = new
61 * ArrayList<Object>(); for(Object val:arr) { valueList.add(val); } return
64 * public static List<Object> converArrayToList(double[] arr) { if(null ==
65 * arr || arr.length < 1) { return null; } List<Object> valueList = new
66 * ArrayList<Object>(); for(Object val:arr) { valueList.add(val); } return
69 * public static List<Object> converArrayToList(boolean[] arr) { if(null ==
70 * arr || arr.length < 1) { return null; } List<Object> valueList = new
71 * ArrayList<Object>(); for(Object val:arr) { valueList.add(val); } return
74 * public static List<Object> converArrayToList(String[] arr) { if(null ==
75 * arr || arr.length < 1) { return null; } List<Object> valueList = new
76 * ArrayList<Object>(); for(Object val:arr) { valueList.add(val); } return