@Override public synchronized void setListener ( final ItemListener listener ) { if ( this.listener != listener ) { handleListenerChange ( listener ); } }
/** * Notify a data change without checking for a real change. * <p> * See {@link #notifyData(Variant, Map, boolean)} when and how to use the * method! * * @param value * the value to send * @param attributes * the attributes to send */ protected void notifyData ( final Variant value, final Map<String, Variant> attributes ) { notifyData ( value, attributes, false ); }
Variant cacheValue = getCacheValue (); if ( cacheValue != null && cacheValue.isNull () ) Map<String, Variant> cacheAttributes = getCacheAttributes (); if ( cacheAttributes != null && cacheAttributes.isEmpty () ) notifyData ( cacheValue, cacheAttributes, true );
public void set ( final Variant value, final Map<String, Variant> values ) { Map<String, Variant> diff = new HashMap<String, Variant> (); synchronized ( this.attributes ) { AttributesHelper.set ( this.attributes, values, diff ); if ( value != null || !diff.isEmpty () ) { if ( diff.isEmpty () ) { // don't send attribute diff if we don't have one diff = null; } this.item.notifyData ( value, diff ); } } }
public void update ( final Variant value, final Map<String, Variant> updates ) { Map<String, Variant> diff = new HashMap<String, Variant> (); synchronized ( this.attributes ) { AttributesHelper.mergeAttributes ( this.attributes, updates, diff ); if ( value != null || !diff.isEmpty () ) { if ( diff.isEmpty () ) { // don't send attribute diff if we don't have one diff = null; } this.item.notifyData ( value, diff ); } } }