package com.capgemini.reports.teamcenter.queries.saved;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.framework.teamcenter.queries.saved.AbstractReplicatedQuery;
import com.teamcenter.soa.client.model.strong.Form;

/**
 * This class is able to look for Product types in Teamcenter. These objects are of type {@link Form}.
 */
public class ProductTypeQuery extends AbstractReplicatedQuery<Form, ProductTypeQuery> {

    /**
     * Query name of Teamcenter for requesting a Product type.
     **/
    private static final String QUERY_SUFFIX_PRODUCT_TYPE = "Product Type";

    /**
     * Constructor to build a Query for Product Types.
     *
     * @param session the session for the connection
     */
    public ProductTypeQuery(final TcSession session) {
        super(session, QUERY_SUFFIX_PRODUCT_TYPE);
    }

    /**
     * Request a specific product type name.
     *
     * @param typeProduit the 'type produit' name
     */
    public void addNomTypeProduit(final String typeProduit) {
        this.addParam(PARAM_NOM_TYPE_PRODUIT, typeProduit);
    }

    @Override
    protected ProductTypeQuery selfCast() {
        return this;
    }
}
