001/*
002 *   Copyright 2020 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
018public class ListApplicationRequest {
019    private long pageSize;
020    private long page;
021
022    private ListApplicationRequest(Builder builder) {
023        this.pageSize = builder.pageSize;
024        this.page = builder.page;
025    }
026
027    public long getPageSize() {
028        return pageSize;
029    }
030
031    public long getPage() {
032        return page;
033    }
034
035    public static Builder builder() {
036        return new Builder();
037    }
038
039    public static class Builder {
040        private long pageSize;
041        private long page;
042
043        /**
044         * @param pageSize The number of applications per page.
045         *
046         * @return The {@link Builder} to keep building.
047         */
048        public Builder pageSize(long pageSize) {
049            this.pageSize = pageSize;
050            return this;
051        }
052
053        /**
054         * @param page The current page number, starts at 1.
055         *
056         * @return The {@link Builder} to keep building.
057         */
058        public Builder page(long page) {
059            this.page = page;
060            return this;
061        }
062
063        /**
064         * @return A new {@link ListApplicationRequest} from the stored configuration.
065         */
066        public ListApplicationRequest build() {
067            return new ListApplicationRequest(this);
068        }
069    }
070}