All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dellroad.stuff.vaadin7.AlwaysInvalidQueryList Maven / Gradle / Ivy

There is a newer version: 2.6.1
Show newest version

/*
 * Copyright (C) 2022 Archie L. Cobbs. All rights reserved.
 */

package org.dellroad.stuff.vaadin7;

/**
 * A {@link QueryList} that always throws {@link InvalidQueryListException}.
 */
public class AlwaysInvalidQueryList implements QueryList {

    private final long size;

    /**
     * Constructor.
     *
     * @param size size of this list to report via {@link #size}
     * @throws IllegalArgumentException if {@code size} is negative
     */
    public AlwaysInvalidQueryList(long size) {
        if (size < 0)
            throw new IllegalArgumentException("size < 0");
        this.size = size;
    }

    public long size() {
        return this.size;
    }

    public T get(long index) throws InvalidQueryListException {
        throw new InvalidQueryListException();
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy