001/* 002 * Copyright 2023 the original author or authors. 003 * <p> 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * <p> 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * <p> 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package de.cuioss.tools.collect; 017 018import java.io.Serializable; 019import java.util.Collection; 020 021/** 022 * Represents a partial collection / sub-collection. It extends the 023 * {@link java.util.Collection} interface with {@link #isMoreAvailable()} flag. 024 * This indicates that the original {@link java.util.Collection} provides more 025 * data than the current {@link de.cuioss.tools.collect.PartialCollection}. It 026 * defines the lower bound for the contained types to 027 * {@link java.io.Serializable}. Currently, the only implementation is 028 * {@link de.cuioss.tools.collect.PartialArrayList}. It provides convenient 029 * methods for instantiation, like 030 * {@link de.cuioss.tools.collect.PartialArrayList#of(java.util.List, int)} 031 * 032 * @param <T> the type of the entity 033 * @author oliver 034 */ 035public interface PartialCollection<T extends Serializable> extends Collection<T>, Serializable { 036 037 /** 038 * <p> 039 * isMoreAvailable. 040 * </p> 041 * 042 * @return {@code true} if more entities are available and ignored due to the 043 * given limit. 044 */ 045 boolean isMoreAvailable(); 046 047}