public void clear() { object.setName(null); object.setWeight(null); super.clear(); clearSoftFields(); }
public Collection<Object> values() { Collection<Object> set = new ArrayList<Object>(); set.add(object.getName()); set.add(object.getWeight()); set.addAll(super.values()); return set; }
public Set<Entry<String, Object>> entrySet() { Set<Entry<String, Object>> set = new HashSet<Entry<String, Object>>(); set.add(TraitProxy.buildEntry("name", object.getName())); set.add(TraitProxy.buildEntry("weight", object.getWeight())); set.addAll(super.entrySet()); return set; }
public Object get(Object key) { if ("name".equals(key)) { return object.getName(); } if ("weight".equals(key)) { return object.getWeight(); } return super.get(key); }
public Object put(String key, Object value) { if ("name".equals(key)) { String old = object.getName(); object.setName((String) value); return old; } if ("weight".equals(key)) { Double old = object.getWeight(); object.setWeight((Double) value); return old; } return super.put(key, value); }
public boolean containsValue(Object value) { if (value == null) { if (object.getName() == null) { return true; } if (object.getWeight() == null) { return true; } } // TODO test : what if value is one of the hard values? return super.containsValue(value); }
public Object remove(Object o) { if ("name".equals(o)) { String x = object.getName(); object.setName(null); return x; } if ("weight".equals(o)) { Double d = object.getWeight(); object.setWeight(null); return d; } if ("flag".equals(o)) { Boolean x = (Boolean) store.get(propertyKey("flag")).getValue(); // TODO : manca il getValue store.put(property("flag", null)); // TODO : manca il property return x; } if ("age".equals(o)) { Integer x = (Integer) store.get(propertyKey("age")).getValue(); // TODO : manca il getValue store.put(property("age", null)); // TODO : manca il property return x; } if ("body".equals(o)) { Weight x = (Weight) store.get(propertyKey("body")).getValue(); // TODO : manca il getValue store.put(property("body", null)); // TODO : manca il property return x; } if ("price".equals(o)) { Price x = (Price) store.get(propertyKey("price")).getValue(); // TODO : manca il getValue store.put(property("price", null)); // TODO : manca il property return x; } if ("bucks".equals(o)) { Integer x = (Integer) store.get(propertyKey("bucks")).getValue(); // TODO : manca il getValue store.put(property("bucks", null)); // TODO : manca il property return x; } if ("likes".equals(o)) { ImpBean.Cheese x = (ImpBean.Cheese) store.get(propertyKey("likes")).getValue(); // TODO : manca il getValue store.put(property("likes", null)); // TODO : manca il property return x; } return super.remove(o); }