class PagingRequest implements ImmutableBean {

  public static PagingRequest ofPage(int page, int pagingSize) {
    ArgumentChecker.notNegativeOrZero(page, "page");
    ArgumentChecker.notNegative(pagingSize, "pagingSize");
    int index = ((page - 1) * pagingSize);
    return new PagingRequest(index, pagingSize);
  }

  @ImmutableConstructor private  PagingRequest(final int index, final int size);

}