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

it.netgrid.woocommerce.jersey.bulk.ProductReviewBulkService Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
package it.netgrid.woocommerce.jersey.bulk;

import java.util.Arrays;
import java.util.List;

import javax.ws.rs.client.WebTarget;

import it.netgrid.woocommerce.model.Product;
import it.netgrid.woocommerce.model.ProductReview;

public class ProductReviewBulkService extends TemplateReadOnlyBulkService {

	public static final String READ_BASE_PATH = "products/%d/reviews";
	
	public ProductReviewBulkService(WebTarget target) {
		super(target);
	}

	@Override
	public String getReadPath(Product context) {
		return String.format(READ_BASE_PATH, context.getId());
	}

	@Override
	public Class getResponseClass() {
		return ProductReview[].class;
	}

	@Override
	public List getResult(ProductReview[] productReviews) {
		return Arrays.asList(productReviews);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy