com.github.datalking.web.mvc.condition.AbstractRequestCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-mvc Show documentation
Show all versions of play-mvc Show documentation
simple mvc framework based on java servlet.
The newest version!
package com.github.datalking.web.mvc.condition;
import java.util.Collection;
import java.util.Iterator;
/**
* @author yaoo on 4/28/18
*/
public abstract class AbstractRequestCondition> implements RequestCondition {
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj != null && getClass().equals(obj.getClass())) {
AbstractRequestCondition> other = (AbstractRequestCondition>) obj;
return getContent().equals(other.getContent());
}
return false;
}
@Override
public int hashCode() {
return getContent().hashCode();
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder("[");
for (Iterator> iterator = getContent().iterator(); iterator.hasNext();) {
Object expression = iterator.next();
builder.append(expression.toString());
if (iterator.hasNext()) {
builder.append(getToStringInfix());
}
}
builder.append("]");
return builder.toString();
}
protected abstract Collection> getContent();
protected abstract String getToStringInfix();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy