/* * Copyright (C) 2022 Alessandro Iezzi * * This file is part of commons-page. * * commons-page is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * commons-page is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with commons-page. If not, see . */ package it.alessandroiezzi.util; import java.util.*; public interface Page { List getContent(); int getPageSize(); int getNumberOfElements(); static Page of(List content, int pageSize) { return new PageImpl<>(content, pageSize); } }