001/* 002 * Copyright 2024 Vonage 003 * 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 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 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 com.vonage.client.application; 017 018import com.vonage.client.common.HalFilterRequest; 019 020/** 021 * Query parameters for {@link ApplicationClient#listApplications(ListApplicationRequest)}. 022 */ 023public class ListApplicationRequest extends HalFilterRequest { 024 025 private ListApplicationRequest(Builder builder) { 026 super(builder); 027 } 028 029 @Override 030 public Integer getPage() { 031 return super.getPage(); 032 } 033 034 @Override 035 public Integer getPageSize() { 036 return super.getPageSize(); 037 } 038 039 /** 040 * Entry point for constructing an instance of this class. 041 * 042 * @return A new Builder. 043 */ 044 public static Builder builder() { 045 return new Builder(); 046 } 047 048 public static class Builder extends HalFilterRequest.Builder<ListApplicationRequest, Builder> { 049 050 @Deprecated 051 public Builder() { 052 } 053 054 /** 055 * @param pageSize The number of applications per page. 056 * 057 * @return This builder. 058 */ 059 public Builder pageSize(long pageSize) { 060 return super.pageSize((int) pageSize); 061 } 062 063 /** 064 * @param page The current page number, starts at 1. 065 * 066 * @return This builder. 067 */ 068 public Builder page(long page) { 069 return super.page((int) page); 070 } 071 072 /** 073 * @return A new {@link ListApplicationRequest} from the stored configuration. 074 */ 075 public ListApplicationRequest build() { 076 return new ListApplicationRequest(this); 077 } 078 } 079}