package ca.ualberta.lard.model;

/**
 * A CommentRequest is a structure that aids in the retrieving of comments. It unifies the arguments passed around, by being a single structure
 * in which the client can say any number of things they expect of the comment they want. All parameters are optional, and if any of them are set
 * it is assumed the user is requesting Comments relevant to that parameter.
 * @author Troy Pavlek
 *
 */
public class CommentRequest {
	
	/**
	 * The most important parameter. If the CommentRequest contains an ID, then the user is searching for a specific, single comment.
	 */
	private String id;
	/**
	 * If the location property is set, Comments nearest this location will be returned over those further from this location.
	 */
	private GeoLocation location;
	/**
	 * Do we only want to search threads, or are replies acceptable also?
	 */
	private boolean topLevel;
	/**
	 * Do we only want comments with pictures?
	 */
	private boolean hasPicture;
	/**
	 * The number of results we want returned
	 */
	private int resultSize;
	
	/**
	 * Instantiates the Comment Request
	 * <p>
	 * All the constructor does is instantiates the object with our expected return size. The user should be setting the remainder of the parameters of the
	 * CommentRequest with the available setters.
	 * </p>
	 * @param num The number of results we want. We may get less, but we will never get more.
	 */
	public CommentRequest(int num) {
		this.resultSize = num;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public void setLocation(GeoLocation loc) {
		this.location = loc;
	}
	
	public void onlyThreads() {
		this.topLevel = true;
	}
	
	public void onlyReplies() {
		this.topLevel = false;
	}
	
	public void withPictures() {
		this.hasPicture = true;
	}
	
	public void withoutPictures() {
		this.hasPicture = false;
	}

}

Comment request created. No tests created, because it has literally zero logic. It's a glorified struct