@Test public void nonZeroShouldFilterZero() { assertThat(QuotaThreshold.ZERO.nonZero()) .isEmpty(); }
public Optional<QuotaThreshold> nonZero() { if (this.equals(ZERO)) { return Optional.empty(); } return Optional.of(this); }
QuotaThreshold implements Comparable<QuotaThreshold> { public Optional<QuotaThreshold> nonZero() { if (this.equals(ZERO)) { return Optional.empty(); } return Optional.of(this); } }
QuotaThreshold implements Comparable<QuotaThreshold> { public Optional<QuotaThreshold> nonZero() { if (this.equals(ZERO)) { return Optional.empty(); } return Optional.of(this); } QuotaThreshold(double quotaOccupationRatio); }
QuotaThreshold implements Comparable<QuotaThreshold> { public Optional<QuotaThreshold> nonZero() { if (this.equals(ZERO)) { return Optional.empty(); } return Optional.of(this); } QuotaThreshold(double quotaOccupationRatio); double getQuotaOccupationRatio(); int getQuotaOccupationRatioAsPercent(); boolean isExceeded(Quota<?, ?> quota); Optional<QuotaThreshold> nonZero(); @Override int compareTo(QuotaThreshold o); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); }
QuotaThreshold implements Comparable<QuotaThreshold> { public Optional<QuotaThreshold> nonZero() { if (this.equals(ZERO)) { return Optional.empty(); } return Optional.of(this); } QuotaThreshold(double quotaOccupationRatio); double getQuotaOccupationRatio(); int getQuotaOccupationRatioAsPercent(); boolean isExceeded(Quota<?, ?> quota); Optional<QuotaThreshold> nonZero(); @Override int compareTo(QuotaThreshold o); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); static final QuotaThreshold ZERO; }