/** * Sets the WHEN and THEN parts of this CASE expression. * Both lists should have the same number of Expressions. * @param when a non-null List of at least one Expression * @param then a non-null List of at least one Expression */ public void setWhen(List when, List then) { if (when == null || then == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$ } if (when.size() != then.size() || when.size() < 1) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$ } for (int i = 0 ; i < when.size(); i++) { if (!(when.get(i) instanceof Expression)) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0037")); //$NON-NLS-1$ } if (!(then.get(i) instanceof Expression)) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$ } } if (this.when != when) { this.when = Collections.unmodifiableList(when); } setThen(then); }
/** * Sets the WHEN and THEN parts of this CASE expression. * Both lists should have the same number of Expressions. * @param when a non-null List of at least one Expression * @param then a non-null List of at least one Expression */ public void setWhen(List when, List then) { if (when == null || then == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$ } if (when.size() != then.size() || when.size() < 1) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$ } for (int i = 0 ; i < when.size(); i++) { if (!(when.get(i) instanceof Expression)) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0037")); //$NON-NLS-1$ } if (!(then.get(i) instanceof Expression)) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$ } } if (this.when != when) { this.when = Collections.unmodifiableList(when); } setThen(then); }
/** * Sets the WHEN and THEN parts of this CASE expression. * Both lists should have the same number of Expressions. * @param when a non-null List of at least one Expression * @param then a non-null List of at least one Expression */ public void setWhen(List when, List then) { if (when == null || then == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$ } if (when.size() != then.size() || when.size() < 1) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$ } for (int i = 0 ; i < when.size(); i++) { if (!(when.get(i) instanceof Expression)) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0037")); //$NON-NLS-1$ } if (!(then.get(i) instanceof Expression)) { throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$ } } if (this.when != when) { this.when = Collections.unmodifiableList(when); } setThen(then); }