BoolRef
This commit is contained in:
@@ -42,12 +42,12 @@ public class NodeHttpServer extends NodeServer {
|
|||||||
protected ClassFilter<? extends WebSocket> webSocketFilter;
|
protected ClassFilter<? extends WebSocket> webSocketFilter;
|
||||||
|
|
||||||
public NodeHttpServer(Application application, AnyValue serconf) {
|
public NodeHttpServer(Application application, AnyValue serconf) {
|
||||||
super(application, createServer(application, serconf));
|
super(application, createServer(application));
|
||||||
this.httpServer = (HttpServer) server;
|
this.httpServer = (HttpServer) server;
|
||||||
this.rest = serconf != null && serconf.getAnyValue("rest") != null;
|
this.rest = serconf != null && serconf.getAnyValue("rest") != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Server createServer(Application application, AnyValue serconf) {
|
private static Server createServer(Application application) {
|
||||||
return new HttpServer(
|
return new HttpServer(
|
||||||
application,
|
application,
|
||||||
application.getStartTime(),
|
application.getStartTime(),
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.redkale.util;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 简单的boolean值引用
|
|
||||||
*
|
|
||||||
* <p>详情见: https://redkale.org
|
|
||||||
*
|
|
||||||
* @author zhangjx
|
|
||||||
* @since 2.8.0
|
|
||||||
*/
|
|
||||||
public final class BoolRef {
|
|
||||||
|
|
||||||
private boolean value;
|
|
||||||
|
|
||||||
public BoolRef(boolean initialValue) {
|
|
||||||
this.value = initialValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoolRef() {}
|
|
||||||
|
|
||||||
public boolean get() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void set(boolean newValue) {
|
|
||||||
this.value = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoolRef asFalse() {
|
|
||||||
this.value = false;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoolRef asTrue() {
|
|
||||||
this.value = true;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return String.valueOf(this.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user