static void set(EncodeState state, Splittable data, int index, Coder coder, Object value) { data.setReified(String.valueOf(index), value); if (value == null) { Splittable.NULL.assign(data, index); return; } Splittable backing = coder.extractSplittable(state, value); if (backing == null) { /* * External data type, such as an ArrayList or a concrete implementation * of a setter's interface type. This means that a slow serialization pass * is necessary. */ data.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { backing.assign(data, index); } }
public void clear() { for (String key : data.getPropertyKeys()) { Splittable.NULL.assign(data, key); reified.setReified(key, null); } }
public V remove(Object key) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, null); Splittable.NULL.assign(data, encodedKey); return toReturn; }
@Override public E remove(int index) { E toReturn = get(index); // XXX This is terrible, use Array.splice int newSize = data.size() - 1; for (int i = index; i < newSize; i++) { data.get(i + 1).assign(data, i); // reified value for index 'i' may needs to be updated if (data.isReified(String.valueOf(i + 1))) { data.setReified(String.valueOf(i), data.getReified(String.valueOf(i + 1))); } else if (data.isReified(String.valueOf(i))) { // Remove outdated value. Will be regenerated if needed. data.removeReified(String.valueOf(i)); } } // clean-up last entry as one element has been removed data.removeReified(String.valueOf(newSize)); data.setSize(newSize); return toReturn; }
protected void setProperty(String propertyName, Object value) { checkWrapped(); checkFrozen(); data.setReified(propertyName, value); if (value == null) { Splittable.NULL.assign(data, propertyName); return; } Coder coder = AutoBeanCodexImpl.doCoderFor(this, propertyName); Splittable backing = coder.extractSplittable(EncodeState.forDecode(factory), value); if (backing == null) { /* * External data type, such as an ArrayList or a concrete implementation * of a setter's interface type. This means that a slow serialization pass * is necessary. */ data.setReified(UNSPLITTABLE_VALUES_KEY, true); } else { backing.assign(data, propertyName); } }
public V put(K key, V value) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, value); Splittable encodedValue = valueCoder.extractSplittable(state, value); if (encodedValue == null) { // External datastructure reified.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { encodedValue.assign(data, encodedKey); } return toReturn; }
static void set(EncodeState state, Splittable data, int index, Coder coder, Object value) { data.setReified(String.valueOf(index), value); if (value == null) { Splittable.NULL.assign(data, index); return; } Splittable backing = coder.extractSplittable(state, value); if (backing == null) { /* * External data type, such as an ArrayList or a concrete implementation * of a setter's interface type. This means that a slow serialization pass * is necessary. */ data.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { backing.assign(data, index); } }
static void set(EncodeState state, Splittable data, int index, Coder coder, Object value) { data.setReified(String.valueOf(index), value); if (value == null) { Splittable.NULL.assign(data, index); return; } Splittable backing = coder.extractSplittable(state, value); if (backing == null) { /* * External data type, such as an ArrayList or a concrete implementation * of a setter's interface type. This means that a slow serialization pass * is necessary. */ data.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { backing.assign(data, index); } }
static void set(EncodeState state, Splittable data, int index, Coder coder, Object value) { data.setReified(String.valueOf(index), value); if (value == null) { Splittable.NULL.assign(data, index); return; } Splittable backing = coder.extractSplittable(state, value); if (backing == null) { /* * External data type, such as an ArrayList or a concrete implementation * of a setter's interface type. This means that a slow serialization pass * is necessary. */ data.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { backing.assign(data, index); } }
public void clear() { for (String key : data.getPropertyKeys()) { Splittable.NULL.assign(data, key); reified.setReified(key, null); } }
public void clear() { for (String key : data.getPropertyKeys()) { Splittable.NULL.assign(data, key); reified.setReified(key, null); } }
public void clear() { for (String key : data.getPropertyKeys()) { Splittable.NULL.assign(data, key); reified.setReified(key, null); } }
public V remove(Object key) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, null); Splittable.NULL.assign(data, encodedKey); return toReturn; }
public V remove(Object key) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, null); Splittable.NULL.assign(data, encodedKey); return toReturn; }
public V remove(Object key) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, null); Splittable.NULL.assign(data, encodedKey); return toReturn; }
@Override public E remove(int index) { E toReturn = get(index); // XXX This is terrible, use Array.splice int newSize = data.size() - 1; for (int i = index; i < newSize; i++) { data.get(i + 1).assign(data, i); // reified value for index 'i' may needs to be updated if (data.isReified(String.valueOf(i + 1))) { data.setReified(String.valueOf(i), data.getReified(String.valueOf(i + 1))); } else if (data.isReified(String.valueOf(i))) { // Remove outdated value. Will be regenerated if needed. data.removeReified(String.valueOf(i)); } } // clean-up last entry as one element has been removed data.removeReified(String.valueOf(newSize)); data.setSize(newSize); return toReturn; }
@Override public E remove(int index) { E toReturn = get(index); // XXX This is terrible, use Array.splice int newSize = data.size() - 1; for (int i = index; i < newSize; i++) { data.get(i + 1).assign(data, i); // reified value for index 'i' may needs to be updated if (data.isReified(String.valueOf(i + 1))) { data.setReified(String.valueOf(i), data.getReified(String.valueOf(i + 1))); } else if (data.isReified(String.valueOf(i))) { // Remove outdated value. Will be regenerated if needed. data.removeReified(String.valueOf(i)); } } // clean-up last entry as one element has been removed data.removeReified(String.valueOf(newSize)); data.setSize(newSize); return toReturn; }
public V put(K key, V value) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, value); Splittable encodedValue = valueCoder.extractSplittable(state, value); if (encodedValue == null) { // External datastructure reified.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { encodedValue.assign(data, encodedKey); } return toReturn; }
public V put(K key, V value) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, value); Splittable encodedValue = valueCoder.extractSplittable(state, value); if (encodedValue == null) { // External datastructure reified.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { encodedValue.assign(data, encodedKey); } return toReturn; }
public V put(K key, V value) { V toReturn = get(key); String encodedKey = encodedKey(key); reified.setReified(encodedKey, value); Splittable encodedValue = valueCoder.extractSplittable(state, value); if (encodedValue == null) { // External datastructure reified.setReified(AbstractAutoBean.UNSPLITTABLE_VALUES_KEY, true); } else { encodedValue.assign(data, encodedKey); } return toReturn; }