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

com.iyzipay.model.subscription.builder.PageRequestQueryParamBuilder Maven / Gradle / Ivy

There is a newer version: 2.0.133
Show newest version
package com.iyzipay.model.subscription.builder;

import java.util.HashMap;
import java.util.Map;

public class PageRequestQueryParamBuilder {

    private Map subscriptionCustomerQueryParams;

    public PageRequestQueryParamBuilder() {
        subscriptionCustomerQueryParams = new HashMap();
    }

    public PageRequestQueryParamBuilder page(Integer page) {
        if (page != null) {
            subscriptionCustomerQueryParams.put("page", page);
        }
        return this;
    }

    public PageRequestQueryParamBuilder count(Integer count) {
        if (count != null) {
            subscriptionCustomerQueryParams.put("count", count);
        }
        return this;
    }

    public String build() {
        StringBuilder queryParams = new StringBuilder();
        if (subscriptionCustomerQueryParams.size() > 0) {
            queryParams.append("?");
        }
        for (Map.Entry entry : subscriptionCustomerQueryParams.entrySet()) {
            queryParams
                    .append(entry.getKey())
                    .append("=")
                    .append(entry.getValue().toString())
                    .append("&");
        }
        return queryParams.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy