本文整理汇总了Java中io.netty.handler.codec.http.HttpResponseStatus.equals方法的典型用法代码示例。如果您正苦于以下问题:Java HttpResponseStatus.equals方法的具体用法?Java HttpResponseStatus.equals怎么用?Java HttpResponseStatus.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.handler.codec.http.HttpResponseStatus
的用法示例。
在下文中一共展示了HttpResponseStatus.equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isMoved
import io.netty.handler.codec.http.HttpResponseStatus; //导入方法依赖的package包/类
/**
* Tells if HTTP response server has moved its {@code URL}.
*
* @param status instance of {@code HttpResponseStatus}
* @return {@code true} if {@code URL} is moved; otherwise,
* {@code false}
*/
public static boolean isMoved(HttpResponseStatus status) {
if (status.equals(HttpResponseStatus.FOUND) ||
status.equals(HttpResponseStatus.MOVED_PERMANENTLY) ||
status.equals(HttpResponseStatus.TEMPORARY_REDIRECT)) {
return true;
} else {
return false;
}
}
示例2: isNotFound
import io.netty.handler.codec.http.HttpResponseStatus; //导入方法依赖的package包/类
/**
* Tells if HTTP response server is not found.
*
* @param status instance of {@code HttpResponseStatus}
* @return {@code true} if page is not found; otherwise,
* {@code false}
*/
public static boolean isNotFound(HttpResponseStatus status) {
if (status.equals(HttpResponseStatus.NOT_FOUND)) {
return true;
} else {
return false;
}
}
示例3: isInvalid
import io.netty.handler.codec.http.HttpResponseStatus; //导入方法依赖的package包/类
/**
* Tells if HTTP response server failed to accept the request.
*
* @param status instance of {@code HttpResponseStatus}
* @return {@code true} if it is bad request; otherwise,
* {@code false}
*/
public static boolean isInvalid(HttpResponseStatus status) {
if (status.equals(HttpResponseStatus.BAD_REQUEST) ||
status.equals(HttpResponseStatus.NOT_IMPLEMENTED)) {
return true;
} else {
return false;
}
}
示例4: isOK
import io.netty.handler.codec.http.HttpResponseStatus; //导入方法依赖的package包/类
/**
* Tells if HTTP response server successfully accepts the request.
*
* @param status instance of {@code HttpResponseStatus}
* @return {@code true} if it accepts; otherwise, {@code false}
*/
public static boolean isOK(HttpResponseStatus status) {
if (status.equals(HttpResponseStatus.OK)) {
return true;
} else{
return false;
}
}
示例5: CheckResult
import io.netty.handler.codec.http.HttpResponseStatus; //导入方法依赖的package包/类
public CheckResult(HttpResponseStatus status) {
this.isOk = false;
this.status = status;
if (status.equals(HttpResponseStatus.UNAUTHORIZED)) {
exception = new UnauthorizedException();
}
else if (status.equals(HttpResponseStatus.FORBIDDEN)) {
exception = new ForbiddenException();
}
}