package ru.yandex.autotests.directapi.darkside.model.bmapi.request;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by pavryabov on 07.08.15.
 */
@XmlRootElement
public class Categories {

    private List<Category> categories;

    public List<Category> getCategories() {
        if (categories == null) {
            categories = new ArrayList<Category>();
        }
        return this.categories;
    }

    @XmlElement(name = "category")
    public void setCategories(List<Category> categories) {
        this.categories = categories;
    }

    public Categories withCategories(Category... categories) {
        this.categories = Arrays.asList(categories);
        return this;
    }
}
