@Test public void setFetchCountExceedsUpperBound() { int tooLarge = FETCH_COUNT_UPPER_BOUND + 1; Throwable actual = thrownBy( () -> timeline.setFetchCount( tooLarge ) ); assertThat( actual ) .isInstanceOf( IllegalArgumentException.class ) .hasMessage( formatErrorMessage( ERROR_EXCEEDS_UPPER_BOUND, tooLarge ) ); }
public void setFetchCount( int fetchCount ) { checkArgument( fetchCount <= FETCH_COUNT_UPPER_BOUND, ERROR_EXCEEDS_UPPER_BOUND, fetchCount ); checkArgument( fetchCount >= FETCH_COUNT_LOWER_BOUND, ERROR_EXCEEDS_LOWER_BOUND, fetchCount ); this.fetchCount = fetchCount; }
Timeline { public void setFetchCount( int fetchCount ) { checkArgument( fetchCount <= FETCH_COUNT_UPPER_BOUND, ERROR_EXCEEDS_UPPER_BOUND, fetchCount ); checkArgument( fetchCount >= FETCH_COUNT_LOWER_BOUND, ERROR_EXCEEDS_LOWER_BOUND, fetchCount ); this.fetchCount = fetchCount; } }
Timeline { public void setFetchCount( int fetchCount ) { checkArgument( fetchCount <= FETCH_COUNT_UPPER_BOUND, ERROR_EXCEEDS_UPPER_BOUND, fetchCount ); checkArgument( fetchCount >= FETCH_COUNT_LOWER_BOUND, ERROR_EXCEEDS_LOWER_BOUND, fetchCount ); this.fetchCount = fetchCount; } Timeline( ItemProvider<T> itemProvider, SessionStorage<T> sessionStorage ); }
Timeline { public void setFetchCount( int fetchCount ) { checkArgument( fetchCount <= FETCH_COUNT_UPPER_BOUND, ERROR_EXCEEDS_UPPER_BOUND, fetchCount ); checkArgument( fetchCount >= FETCH_COUNT_LOWER_BOUND, ERROR_EXCEEDS_LOWER_BOUND, fetchCount ); this.fetchCount = fetchCount; } Timeline( ItemProvider<T> itemProvider, SessionStorage<T> sessionStorage ); void setFetchCount( int fetchCount ); int getFetchCount(); Optional<T> getTopItem(); void setTopItem( T topItem ); void fetchItems(); int getNewCount(); void fetchNew(); List<T> getItems(); }
Timeline { public void setFetchCount( int fetchCount ) { checkArgument( fetchCount <= FETCH_COUNT_UPPER_BOUND, ERROR_EXCEEDS_UPPER_BOUND, fetchCount ); checkArgument( fetchCount >= FETCH_COUNT_LOWER_BOUND, ERROR_EXCEEDS_LOWER_BOUND, fetchCount ); this.fetchCount = fetchCount; } Timeline( ItemProvider<T> itemProvider, SessionStorage<T> sessionStorage ); void setFetchCount( int fetchCount ); int getFetchCount(); Optional<T> getTopItem(); void setTopItem( T topItem ); void fetchItems(); int getNewCount(); void fetchNew(); List<T> getItems(); static final int FETCH_COUNT_LOWER_BOUND; static final int FETCH_COUNT_UPPER_BOUND; static final int DEFAULT_FETCH_COUNT; }