/*
 * 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 QueryMember. 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 QueryMember to make the main class more readable.
 * @author Oriol
 */
public class QueryMemberBuilder {
    
    //QueryObject Attributes
    private String _nResults = "100";
    private QueryObject.Ordering _order = Ordering.TIME_DOWN;
    private String _offset;
    
    //QueryEvent Attributes
    private String _memberID = null;

    
    public QueryMemberBuilder(){}
    
    public QueryMember buildQuery(){
        return new QueryMember(_nResults, _order, _offset, _memberID);
    }

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

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

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

    public QueryMemberBuilder _memberID(String _memberID) {
        this._memberID = _memberID;
        return this;
    }
    
}
