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

com.notronix.etsy.impl.method.FindAllListingActiveMethod Maven / Gradle / Ivy

There is a newer version: 3.0.0014
Show newest version
package com.notronix.etsy.impl.method;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.notronix.etsy.impl.model.EtsyListing;

import java.util.List;

import static com.notronix.etsy.impl.method.MethodUtils.addIfProvided;

public class FindAllListingActiveMethod extends AbstractEtsyMethod>>
{
    private Integer limit;
    private Integer offset;

    @Override
    public String getURI() {
        String uri = "/listings/active";
        uri = addIfProvided(uri, "limit", limit);
        uri = addIfProvided(uri, "offset", offset);

        return uri;
    }

    @Override
    public EtsyResponse> getResponse(Gson gson, String jsonPayload) {
        return gson.fromJson(jsonPayload, new TypeToken>>(){}.getType());
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public FindAllListingActiveMethod withLimit(Integer limit) {
        this.limit = limit;
        return this;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public FindAllListingActiveMethod withOffset(Integer offset) {
        this.offset = offset;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy