@Override public void addAllCron(Collection<Cron> cron) { if (cron == null) { return; } for (Cron item : cron) { addCron(item); } }
@Override public void addAllValues(Collection<String> values) { if (values == null) { return; } for (String item : values) { addValues(item); } }
@Override public Date getDate() { fireOnPreRead(PROPERTY_DATE, date); Date result = this.date; fireOnPostRead(PROPERTY_DATE, date); return result; }
@Override public void setDate(Date date) { Date oldValue = this.date; fireOnPreWrite(PROPERTY_DATE, oldValue, date); this.date = date; fireOnPostWrite(PROPERTY_DATE, oldValue, date); }
@Override public boolean isValuesEmpty() { int size = sizeValues(); return size == 0; }
@Override public boolean isCronEmpty() { int size = sizeCron(); return size == 0; }
@Override public void setEvent(Event event) { Event oldValue = this.event; fireOnPreWrite(PROPERTY_EVENT, oldValue, event); this.event = event; fireOnPostWrite(PROPERTY_EVENT, oldValue, event); }
@Override public void setCron(Collection<Cron> cron) { // Copy elements to keep data for fire with new reference Collection<Cron> oldValue = this.cron != null ? new ArrayList<Cron>(this.cron) : null; fireOnPreWrite(PROPERTY_CRON, oldValue, cron); this.cron = cron; fireOnPostWrite(PROPERTY_CRON, oldValue, cron); }
@Override public Event getEvent() { fireOnPreRead(PROPERTY_EVENT, event); Event result = this.event; fireOnPostRead(PROPERTY_EVENT, event); return result; }
@Override public void setValues(Collection<String> values) { // Copy elements to keep data for fire with new reference Collection<String> oldValue = this.values != null ? new ArrayList<String>(this.values) : null; fireOnPreWrite(PROPERTY_VALUES, oldValue, values); this.values = values; fireOnPostWrite(PROPERTY_VALUES, oldValue, values); }
@Override public void clearValues() { if (this.values == null) { return; } Collection<String> oldValue = new ArrayList<String>(this.values); fireOnPreWrite(PROPERTY_VALUES, oldValue, this.values); this.values.clear(); fireOnPostWrite(PROPERTY_VALUES, oldValue, this.values); }
@Override public void addValues(String values) { fireOnPreWrite(PROPERTY_VALUES, null, values); if (this.values == null) { this.values = new ArrayList<String>(); } this.values.add(values); fireOnPostWrite(PROPERTY_VALUES, this.values.size(), null, values); }
@Override public void clearCron() { if (this.cron == null) { return; } Collection<Cron> oldValue = new ArrayList<Cron>(this.cron); fireOnPreWrite(PROPERTY_CRON, oldValue, this.cron); this.cron.clear(); fireOnPostWrite(PROPERTY_CRON, oldValue, this.cron); }
@Override public void removeValues(String values) { fireOnPreWrite(PROPERTY_VALUES, values, null); if (this.values == null || !this.values.remove(values)) { throw new IllegalArgumentException("List does not contain given element"); } fireOnPostWrite(PROPERTY_VALUES, this.values.size() + 1, values, null); }
@Override public void addCron(Cron cron) { fireOnPreWrite(PROPERTY_CRON, null, cron); if (this.cron == null) { this.cron = new ArrayList<Cron>(); } this.cron.add(cron); fireOnPostWrite(PROPERTY_CRON, this.cron.size(), null, cron); }
@Override public void removeCron(Cron cron) { fireOnPreWrite(PROPERTY_CRON, cron, null); if (this.cron == null || !this.cron.remove(cron)) { throw new IllegalArgumentException("List does not contain given element"); } fireOnPostWrite(PROPERTY_CRON, this.cron.size() + 1, cron, null); }