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

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

There is a newer version: 1.5.6
Show newest version
package com.hannesdorfmann.httpkit.parser.condition;

/**
 * Concatinates two {@link ParseCondition} by a OR condition. So at least one of
 * two conditions must be fullfilled to fullfill this condition
 * 
 * @author Hannes Dorfmann
 * 
 */
public class OrCondition implements ParseCondition {

	private ParseCondition first;
	private ParseCondition second;

	public OrCondition() {

	}

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

	public ParseCondition getFirst() {
		return first;
	}

	public ParseCondition getSecond() {
		return second;
	}

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

	public OrCondition 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