- Timestamp:
- 09/23/13 18:54:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/PropertiesObject.java
r105 r107 1 1 package com.framsticks.params; 2 2 3 import java.util.Map; 4 import java.util.TreeMap; 5 6 import com.framsticks.util.lang.Casting; 7 8 public class PropertiesObject { 9 10 protected final String framsTypeName; 11 protected final Map<String, Object> values = new TreeMap<>(); 3 public class PropertiesObject extends MapBasedObject { 12 4 13 5 /** 14 * @param framsTypeName6 * 15 7 */ 16 8 public PropertiesObject(String framsTypeName) { 17 this.framsTypeName = framsTypeName;9 super(framsTypeName); 18 10 } 19 11 20 public <T> void set(String id, T value) {21 values.put(id, value);22 }23 24 public <T> T get(String id, Class<T> type) {25 return Casting.nullOrThrowCast(type, values.get(id));26 }27 28 public void clear() {29 values.clear();30 }31 32 public int size() {33 return values.size();34 }35 36 @Override37 public String toString() {38 return values.toString();39 }40 41 /**42 * @return the framsTypeName43 */44 public String getFramsTypeName() {45 return framsTypeName;46 }47 12 }
Note: See TracChangeset
for help on using the changeset viewer.