BrightSide Workbench Full Report + Source Code
BrightSide/elephant-zkoss/src/main/java/org/turro/elephant/zkoss/RoleMap.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.elephant.zkoss;
19 
20 import java.util.Collection;
21 import java.util.Map;
22 import java.util.Map.Entry;
23 import java.util.Set;
24 import org.turro.elephant.context.Application;
25 
30 public class RoleMap implements Map<String, Boolean> {
31 
32  private Application app;
33 
34  public RoleMap(Application app) {
35  this.app = app;
36  }
37 
38  @Override
39  public int size() {
40  throw new UnsupportedOperationException("Not supported yet.");
41  }
42 
43  @Override
44  public boolean isEmpty() {
45  throw new UnsupportedOperationException("Not supported yet.");
46  }
47 
48  @Override
49  public boolean containsKey(Object key) {
50  return app.hasAnyRoleKey((String) key);
51  }
52 
53  @Override
54  public boolean containsValue(Object value) {
55  throw new UnsupportedOperationException("Not supported yet.");
56  }
57 
58  @Override
59  public Boolean get(Object key) {
60  return app.isInRole((String) key);
61  }
62 
63  @Override
64  public Boolean put(String key, Boolean value) {
65  throw new UnsupportedOperationException("Not supported yet.");
66  }
67 
68  @Override
69  public Boolean remove(Object key) {
70  throw new UnsupportedOperationException("Not supported yet.");
71  }
72 
73  @Override
74  public void putAll(Map<? extends String, ? extends Boolean> m) {
75  throw new UnsupportedOperationException("Not supported yet.");
76  }
77 
78  @Override
79  public void clear() {
80  throw new UnsupportedOperationException("Not supported yet.");
81  }
82 
83  @Override
84  public Set<String> keySet() {
85  throw new UnsupportedOperationException("Not supported yet.");
86  }
87 
88  @Override
89  public Collection<Boolean> values() {
90  throw new UnsupportedOperationException("Not supported yet.");
91  }
92 
93  @Override
94  public Set<Entry<String, Boolean>> entrySet() {
95  throw new UnsupportedOperationException("Not supported yet.");
96  }
97 
98 }