All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hannesdorfmann.httpkit.parser.condition.AndCondition Maven / Gradle / Ivy

package com.hannesdorfmann.httpkit.parser.condition;

/**
 * Concatinates two {@link ParseCondition} by a AND condition. So both must be
 * fullfilled to fullfill this condition
 * 
 * @author Hannes Dorfmann
 * 
 */
public class AndCondition implements ParseCondition {

	private ParseCondition first;
	private ParseCondition second;

	public AndCondition() {

	}

	public AndCondition(ParseCondition first, ParseCondition second) {
		this.first = first;
		this.second = second;
	}

	public ParseCondition getFirst() {
		return first;
	}

	public ParseCondition getSecond() {
		return second;
	}

	public AndCondition setFirst(ParseCondition first) {
		this.first = first;
		return this;
	}

	public AndCondition setSecond(ParseCondition second) {
		this.second = second;
		return this;
	}

	@Override
	public boolean isFullfilled(int httpStatusCode) {
		return first.isFullfilled(httpStatusCode)
				&& second.isFullfilled(httpStatusCode);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy