001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.commons.beanquery; 018 019/** 020 * What a caller asks {@link BeanQuery.Builder#counts(CountRequest)} to write onto a {@link BeanQuery}'s 021 * {@code opts} (design ยง5). 022 * 023 * <p> 024 * This is the builder-facing counterpart of the session-side {@link CountPolicy}: {@code CountPolicy} 025 * decides whether a session honors a count request at all; {@code CountRequest} is what the request asks for. 026 * 027 * <h5 class='section'>Example:</h5> 028 * <p class='bjava'> 029 * BeanQuery <jv>q</jv> = BeanQuery.<jsm>create</jsm>().counts(CountRequest.<jsf>BOTH</jsf>).build(); 030 * </p> 031 * 032 * @since 10.0.0 033 */ 034public enum CountRequest { 035 036 /** Request no counts. Writing this removes the {@code counts} opt if one was set. */ 037 NONE, 038 039 /** Request only the matched-row count ({@code counts=matched}). */ 040 MATCHED, 041 042 /** Request both the total and matched counts ({@code counts=both}). */ 043 BOTH 044}