diff --git a/src/org/redkale/net/http/HttpRequest.java b/src/org/redkale/net/http/HttpRequest.java index 9a6bd8858..f49001410 100644 --- a/src/org/redkale/net/http/HttpRequest.java +++ b/src/org/redkale/net/http/HttpRequest.java @@ -286,10 +286,10 @@ public class HttpRequest extends Request { @Override public String toString() { parseBody(); - return this.getClass().getSimpleName() + "{method:" + this.method + ", requestURI:" + this.requestURI - + ", remoteAddr:" + this.getRemoteAddr() + ", cookies:" + this.cookiestr + ", contentType:" + this.contentType - + ", connection:" + this.connection + ", protocol:" + this.protocol + ", contentLength:" + this.contentLength - + ", host:" + this.host + ", bodylength:" + this.array.size() + ", params:" + this.params + ", header:" + this.header + "}"; + return this.getClass().getSimpleName() + "{\r\n method: " + this.method + ", \r\n requestURI: " + this.requestURI + + ", \r\n remoteAddr: " + this.getRemoteAddr() + ", \r\n cookies: " + this.cookiestr + ", \r\n contentType: " + this.contentType + + ", \r\n connection: " + this.connection + ", \r\n protocol: " + this.protocol + ", \r\n contentLength: " + this.contentLength + + ", \r\n host: " + this.host + ", \r\n bodylength: " + this.array.size() + ", \r\n params: " + this.params.toString(4) + ", \r\n header: " + this.header.toString(4) + "\r\n}"; } /** diff --git a/src/org/redkale/util/AnyValue.java b/src/org/redkale/util/AnyValue.java index c418cec4c..77086c64d 100644 --- a/src/org/redkale/util/AnyValue.java +++ b/src/org/redkale/util/AnyValue.java @@ -12,7 +12,9 @@ import java.util.function.BiPredicate; /** * 该类提供类似JSONObject的数据结构,主要用于读取xml配置文件和http-header存储 * - *

详情见: http://redkale.org + *

+ * 详情见: http://redkale.org + * * @author zhangjx */ @SuppressWarnings("unchecked") @@ -21,25 +23,17 @@ public abstract class AnyValue { /** * 可读写的AnyValue默认实现类 * - *

详情见: http://redkale.org + *

+ * 详情见: http://redkale.org + * * @author zhangjx */ @SuppressWarnings("unchecked") public static final class DefaultAnyValue extends AnyValue { - public static final BiPredicate EQUALS = new BiPredicate() { //为了兼容Android - @Override - public boolean test(String name1, String name2) { - return name1.equals(name2); - } - }; + public static final BiPredicate EQUALS = (name1, name2) -> name1.equals(name2); - public static final BiPredicate EQUALSIGNORE = new BiPredicate() { //为了兼容Android - @Override - public boolean test(String name1, String name2) { - return name1.equalsIgnoreCase(name2); - } - }; + public static final BiPredicate EQUALSIGNORE = (name1, name2) -> name1.equalsIgnoreCase(name2); private final BiPredicate predicate; @@ -331,7 +325,7 @@ public abstract class AnyValue { return new DefaultAnyValue(); } - protected String toString(int len) { + public String toString(int len) { if (len < 0) len = 0; char[] chars = new char[len]; Arrays.fill(chars, ' ');