/** * Combines the specified {@link StopCondition}s into a single * {@link StopCondition} using the logical OR operator. The returned condition * will return <code>true</code> if <i>any</i> of the specified conditions * return <code>true</code>. * @param condition1 The first condition. * @param condition2 The second condition. * @param more More conditions (optional). * @return A new {@link StopCondition}. */ public static StopCondition or(StopCondition condition1, StopCondition condition2, StopCondition... more) { return Or.create( ImmutableSet.<StopCondition>builder() .add(condition1) .add(condition2) .addAll(asList(more)) .build()); }
/** * Combines the specified {@link StopCondition}s into a single * {@link StopCondition} using the logical OR operator. The returned condition * will return <code>true</code> if <i>any</i> of the specified conditions * return <code>true</code>. * @param condition1 The first condition. * @param condition2 The second condition. * @param more More conditions (optional). * @return A new {@link StopCondition}. */ public static StopCondition or(StopCondition condition1, StopCondition condition2, StopCondition... more) { return Or.create( ImmutableSet.<StopCondition>builder() .add(condition1) .add(condition2) .addAll(asList(more)) .build()); }
static Or create(ImmutableSet<StopCondition> scs) { return new AutoValue_StopConditions_Or(getTypes(scs), scs); } }
static Or create(ImmutableSet<StopCondition> scs) { return new AutoValue_StopConditions_Or(getTypes(scs), scs); } }
@Override public boolean evaluate(TypeProvider provider) { for (final StopCondition sc : stopConditions()) { if (sc.evaluate(provider)) { return true; } } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof StopConditions.Or) { StopConditions.Or that = (StopConditions.Or) o; return (this.getTypes.equals(that.getTypes())) && (this.stopConditions.equals(that.stopConditions())); } return false; }
@Override public boolean evaluate(TypeProvider provider) { for (final StopCondition sc : stopConditions()) { if (sc.evaluate(provider)) { return true; } } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof StopConditions.Or) { StopConditions.Or that = (StopConditions.Or) o; return (this.getTypes.equals(that.getTypes())) && (this.stopConditions.equals(that.stopConditions())); } return false; }