productsearchrequest.java

来自「yahoo api,包括各版本的」· Java 代码 · 共 45 行

JAVA
45
字号
package com.yahoo.shopping;import com.yahoo.rest.RestRequest;public class ProductSearchRequest extends RestRequest {    public static final String SORT_BY_RELEVANCE = "relevance";    public static final String SORT_BY_PRICE = "price";    public ProductSearchRequest(String query) {        super("http://api.shopping.yahoo.com/ShoppingService/V1/productSearch");        setQuery(query);    }    public void setQuery(String query) {        setParameter("query", query);    }    public void setResults(int results) {        setParameter("results", Integer.toString(results));    }    public void setStart(int start) {        setParameter("start", Integer.toString(start));    }    public void setMerchantId(int id) {        setParameter("merchantid", Integer.toString(id));    }    public void setHighestPrice(float price) {        setParameter("highestprice", Float.toString(price));    }    public void setLowestPrice(float price) {        setParameter("lowestprice", Float.toString(price));    }    public void setSort(String sort) {        setParameter("sort", sort);    }    public void setDepartment(int department) {        setParameter("department", Integer.toString(department));    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?