public class Response extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
isSend |
Constructor and Description |
---|
Response()
构造函数
|
Response(Response response)
构造函数
|
Modifier and Type | Method and Description |
---|---|
Body |
body()
获取 Body 对象
|
void |
clear()
清理
|
List<Cookie> |
cookies()
获取所有的Cookies对象,返回一个 List
|
Response |
copyFrom(Response response)
从其他 Response 复制数据到当前对象
用于非发送目的
|
Response |
copyFrom(Response otherResponse,
boolean useForSend)
从其他 Response 复制数据到当前对象
|
Cookie |
getCookie(String name)
根据 Cookie 名称取 Cookie
|
Long |
getMark() |
Header |
header()
获取 Header 对象
|
void |
init(Response response) |
boolean |
isAsync()
是否在路由异步响应
|
boolean |
isCompress()
是否压缩 默认为 true
|
boolean |
isHasBody() |
ResponseProtocol |
protocol()
获取协议对象
|
void |
release() |
void |
send(IoSession session)
发送数据
|
void |
setAsync(boolean async)
是否在路由异步响应
|
void |
setCompress(boolean isCompress)
设置压缩属性
|
void |
setHasBody(boolean hasBody) |
void |
setMark(Long mark) |
String |
toString() |
public Response(Response response)
response
- 响应对象public Response()
public void init(Response response)
public Long getMark()
public void setMark(Long mark)
public boolean isCompress()
public void setCompress(boolean isCompress)
isCompress
- 是否启用个压缩public boolean isAsync()
public void setAsync(boolean async)
async
- true: 异步响应, false: 同步响应public ResponseProtocol protocol()
public Header header()
public Cookie getCookie(String name)
name
- Cookie 名称public Body body()
public boolean isHasBody()
public void setHasBody(boolean hasBody)
public void send(IoSession session) throws IOException
session
- socket 会话对象IOException
- IO异常public void release()
public Response copyFrom(Response response)
response
- 原对象public Response copyFrom(Response otherResponse, boolean useForSend)
otherResponse
- 原对象useForSend
- 是否用户发送public void clear()
Copyright © 2020 Voovan. All rights reserved.