Class DefaultHttpResult
- java.lang.Object
-
- com.github.fmjsjx.libnetty.http.server.DefaultHttpResult
-
- All Implemented Interfaces:
HttpResult
public class DefaultHttpResult extends java.lang.Object implements HttpResult
Default implementation ofHttpResult.- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpResult(HttpRequestContext requestContext, long resultLength, io.netty.handler.codec.http.HttpResponseStatus responseStatus)Creates a newDefaultHttpResultinstance with the specified params given.DefaultHttpResult(HttpRequestContext requestContext, long resultLength, io.netty.handler.codec.http.HttpResponseStatus responseStatus, long respondedNaonTime, java.time.ZonedDateTime respondedTime)Creates a newDefaultHttpResultinstance with the specified params given.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequestContextrequestContext()Returns the context of the HTTP request.longrespondedNaonTime()Returns the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds, when the HTTP response just responded.java.time.ZonedDateTimerespondedTime()Returns theZonedDateTimewith the systemZoneIdwhen the HTTP response just responded.io.netty.handler.codec.http.HttpResponseStatusresponseStatus()Returns the status of the HTTP response.longresultLength()Returns the length of the HTTP response content.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.fmjsjx.libnetty.http.server.HttpResult
nanoUsed, respondedTime, timeUsed
-
-
-
-
Constructor Detail
-
DefaultHttpResult
public DefaultHttpResult(HttpRequestContext requestContext, long resultLength, io.netty.handler.codec.http.HttpResponseStatus responseStatus)
Creates a newDefaultHttpResultinstance with the specified params given.- Parameters:
requestContext- anHttpRequestContextresultLength- the length of the HTTP response body contentresponseStatus- theHttpResponseStatusof the HTTP response
-
DefaultHttpResult
public DefaultHttpResult(HttpRequestContext requestContext, long resultLength, io.netty.handler.codec.http.HttpResponseStatus responseStatus, long respondedNaonTime, java.time.ZonedDateTime respondedTime)
Creates a newDefaultHttpResultinstance with the specified params given.- Parameters:
requestContext- anHttpRequestContextresultLength- the length of the HTTP response body contentresponseStatus- theHttpResponseStatusof the HTTP responserespondedNaonTime- the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds, when the HTTP response just respondedrespondedTime- theZonedDateTimewhen the HTTP response just responded
-
-
Method Detail
-
requestContext
public HttpRequestContext requestContext()
Description copied from interface:HttpResultReturns the context of the HTTP request.- Specified by:
requestContextin interfaceHttpResult- Returns:
- the context of the HTTP request
-
resultLength
public long resultLength()
Description copied from interface:HttpResultReturns the length of the HTTP response content.- Specified by:
resultLengthin interfaceHttpResult- Returns:
- the length of the HTTP response content
-
responseStatus
public io.netty.handler.codec.http.HttpResponseStatus responseStatus()
Description copied from interface:HttpResultReturns the status of the HTTP response.- Specified by:
responseStatusin interfaceHttpResult- Returns:
- the status of the HTTP response
-
respondedNaonTime
public long respondedNaonTime()
Description copied from interface:HttpResultReturns the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds, when the HTTP response just responded.- Specified by:
respondedNaonTimein interfaceHttpResult- Returns:
- the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds
- See Also:
System.nanoTime()
-
respondedTime
public java.time.ZonedDateTime respondedTime()
Description copied from interface:HttpResultReturns theZonedDateTimewith the systemZoneIdwhen the HTTP response just responded.- Specified by:
respondedTimein interfaceHttpResult- Returns:
- a
ZonedDateTime
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-