From a9d8a2173f250cc96d863e2c3f0097c1ac26e728 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 30 Nov 2022 16:27:20 +0100 Subject: Move PageImpl in util package --- .../it/alessandroiezzi/commons/page/PageImpl.java | 53 ---------------------- .../java/it/alessandroiezzi/util/PageImpl.java | 53 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 src/main/java/it/alessandroiezzi/commons/page/PageImpl.java create mode 100644 src/main/java/it/alessandroiezzi/util/PageImpl.java diff --git a/src/main/java/it/alessandroiezzi/commons/page/PageImpl.java b/src/main/java/it/alessandroiezzi/commons/page/PageImpl.java deleted file mode 100644 index 40bc872..0000000 --- a/src/main/java/it/alessandroiezzi/commons/page/PageImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.commons.page; - -import it.alessandroiezzi.util.*; - -import java.util.*; - -public class PageImpl implements Page { - private final List content = new ArrayList<>(); - private final int size; - - public PageImpl(List content, int pageSize) { - int i = pageSize; - for (T element : content) { - if (i-- == 0) break; - this.content.add(element); - } - this.size = pageSize; - } - - @Override - public List getContent() { - return content; - } - - @Override - public int getPageSize() { - return size; - } - - @Override - public int getNumberOfElements() { - return content.size(); - } -} diff --git a/src/main/java/it/alessandroiezzi/util/PageImpl.java b/src/main/java/it/alessandroiezzi/util/PageImpl.java new file mode 100644 index 0000000..186ff71 --- /dev/null +++ b/src/main/java/it/alessandroiezzi/util/PageImpl.java @@ -0,0 +1,53 @@ +/* + * 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 it.alessandroiezzi.util.*; + +import java.util.*; + +public class PageImpl implements Page { + private final List content = new ArrayList<>(); + private final int size; + + public PageImpl(List content, int pageSize) { + int i = pageSize; + for (T element : content) { + if (i-- == 0) break; + this.content.add(element); + } + this.size = pageSize; + } + + @Override + public List getContent() { + return content; + } + + @Override + public int getPageSize() { + return size; + } + + @Override + public int getNumberOfElements() { + return content.size(); + } +} -- cgit v1.2.3