/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package testmeetup;

import testmeetup.QueryObject.Ordering;

/**
 * Following a builder patterm, this class is designed to "clear code" when creating an object of the class QueryRSVP. Instead of having a constructor with a lot of 
 * parameters in an arbitrary order, or using setters or getters, this class has all the parameters of QueryRSVP to make the main class more readable.
 * @author Oriol
 */
public class QueryRSVPBuilder {
    
    //QueryObject Attributes
    private String _nResults = "100";
    private QueryObject.Ordering _order = Ordering.TIME_DOWN;
    private String _offset;
    
    //QueryEvent Attributes
    private String _eventID = null;
    private String _groupURL = null;

    
    public QueryRSVPBuilder(){}
    
    public QueryRSVP buildQuery(){
        return new QueryRSVP(_nResults, _order, _offset, _eventID, _groupURL);
    }

    public QueryRSVPBuilder nResults(String _nResults) {
        this._nResults = _nResults;
        return this;
    }

    public QueryRSVPBuilder order(QueryObject.Ordering _order) {
        this._order = _order;
        return this;
    }

    public QueryRSVPBuilder offset(String _offset) {
        this._offset = _offset;
        return this;
    }

    public QueryRSVPBuilder eventID(String _eventID) {
        this._eventID = _eventID;
        return this;
    }
    
}
