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

com.banxa.model.request.GetFiatCurrenciesRequest Maven / Gradle / Ivy

The newest version!
package com.banxa.model.request;

import com.banxa.model.OrderType;
import com.banxa.model.response.GetFiatCurrenciesResponse;

public class GetFiatCurrenciesRequest extends GetRequest {

    private final OrderType orderType;

    private GetFiatCurrenciesRequest(Builder builder) {
        this.orderType = builder.orderType;
    }

    public GetFiatCurrenciesRequest(OrderType orderType) {
        this.orderType = orderType;
    }

    public OrderType getOrderType() {
        return orderType;
    }

    @Override
    public String getUri() {
        return "/api/fiats/" + orderType.getType();
    }

    @Override
    public Class getResponseClass() {
        return GetFiatCurrenciesResponse.class;
    }

    public static Builder createBuyBuilder() {
        return new Builder(OrderType.BUY);
    }

    public static Builder createSellBuilder() {
        return new Builder(OrderType.SELL);
    }

    public static class Builder {
        private final OrderType orderType;

        public Builder(OrderType orderType) {
            this.orderType = orderType;
        }

        public GetFiatCurrenciesRequest build() {
            return new GetFiatCurrenciesRequest(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy