1 22 package org.jboss.test.mx.mxbean.support; 23 24 import java.util.ArrayList ; 25 import java.util.Collection ; 26 import java.util.List ; 27 import java.util.ListIterator ; 28 import java.util.Map ; 29 import java.util.Set ; 30 31 import org.jboss.mx.mxbean.MXBeanSupport; 32 33 39 public class CollectionsMXBeanSupport extends MXBeanSupport implements CollectionsMXBeanSupportMXBean 40 { 41 String [] array; 42 Collection <String > collection; 43 Set <String > set; 44 List <String > list; 45 Map <String , Integer > map; 46 TestEnum enumeration; 47 48 public CollectionsMXBeanSupport() 49 { 50 } 51 52 public CollectionsMXBeanSupport(String [] array, Collection <String > collection, Set <String > set, List <String > list, Map <String , Integer > map, TestEnum enumeration) 53 { 54 this.array = array; 55 this.collection = collection; 56 this.set = set; 57 this.list = list; 58 this.map = map; 59 this.enumeration = enumeration; 60 } 61 62 public String [] getArray() 63 { 64 return array; 65 } 66 67 public Collection <String > getCollection() 68 { 69 return collection; 70 } 71 72 public List <String > getList() 73 { 74 return list; 75 } 76 77 public Set <String > getSet() 78 { 79 return set; 80 } 81 82 public Map <String , Integer > getMap() 83 { 84 return map; 85 } 86 87 public TestEnum getEnum() 88 { 89 return enumeration; 90 } 91 92 public void setEnum(TestEnum enumeration) 93 { 94 this.enumeration = enumeration; 95 } 96 97 public void setArray(String [] array) 98 { 99 this.array = array; 100 } 101 102 public void setCollection(Collection <String > collection) 103 { 104 this.collection = collection; 105 } 106 107 public void setList(List <String > list) 108 { 109 this.list = list; 110 } 111 112 public void setMap(Map <String , Integer > map) 113 { 114 this.map = map; 115 } 116 117 public void setSet(Set <String > set) 118 { 119 this.set = set; 120 } 121 122 public List <String > echoReverse(List <String > list) 123 { 124 ArrayList <String > result = new ArrayList <String >(list.size()); 125 for (ListIterator <String > i = list.listIterator(list.size()); i.hasPrevious();) 126 result.add(i.previous()); 127 return result; 128 } 129 } 130 | Popular Tags |