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

com.global.api.entities.transactionApi.TransactionApiRequest Maven / Gradle / Ivy

There is a newer version: 14.2.3
Show newest version
package com.global.api.entities.transactionApi;

import com.global.api.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.HashMap;

@Accessors(chain = true)
@Setter
@Getter
public class TransactionApiRequest {

    private HttpMethod verb = HttpMethod.GET;
    private String endpoint;
    private String requestBody = "";
    private HashMap queryStringParams;

    TransactionApiRequest() {
        queryStringParams = new HashMap<>();
    }

    void addQueryStringParam(String name, String value) {
        if (!StringUtils.isNullOrEmpty(name) && !StringUtils.isNullOrEmpty(value)) {
            queryStringParams.put(name, value);
        }
    }

    public enum HttpMethod {
        GET("GET"),
        POST("POST"),
        PATCH("PATCH"),
        PUT("PUT"),
        DELETE("DELETE");

        private final String value;

        HttpMethod(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy