public class BeforeInterfaceOperation extends Object
文件名:BeforeInterfaceOperation.java
用途: 定义接口前置操作的存储,并提供相应操作的执行方法
编码时间:2022年8月1日 上午8:08:54
修改时间:2023年6月21日 上午8:21:14
Modifier and Type | Class and Description |
---|---|
static class |
BeforeInterfaceOperation.BeforeInterfaceOperationType
文件名:BeforeInterfaceOperation.java
|
Constructor and Description |
---|
BeforeInterfaceOperation(InterfaceInfo inter)
指定前置操作执行接口
|
BeforeInterfaceOperation(String name,
InterfaceInfo inter)
指定前置操作执行接口
|
Modifier and Type | Method and Description |
---|---|
EasyResponse |
actionInterface(EasyHttp action)
该方法用于对前置操作为接口的执行方式进行执行
|
String |
getName()
该方法用于返回前置操作名称
|
BeforeInterfaceOperation.BeforeInterfaceOperationType |
getOperationType()
该方法用于返回前置操作的类型
|
boolean |
isExecutedOperation()
该方法用于返回当前操作是否还有可用的执行次数
|
void |
setActionCount(int actionCount)
该方法用于设置当前前置操作在整个接口请求周期中可执行的次数,用于在
#isExecutedOperation() 方法中的判断。
若设置的次数小于1,则表示不限制执行次数 |
public BeforeInterfaceOperation(InterfaceInfo inter)
inter
- 接口信息public BeforeInterfaceOperation(String name, InterfaceInfo inter)
name
- 前置操作名称inter
- 接口信息public String getName()
public EasyResponse actionInterface(EasyHttp action)
action
- 接口请求类EasyHttp
public BeforeInterfaceOperation.BeforeInterfaceOperationType getOperationType()
public void setActionCount(int actionCount)
#isExecutedOperation()
方法中的判断。
若设置的次数小于1,则表示不限制执行次数actionCount
- 操作总执行次数public boolean isExecutedOperation()
由于执行方法中不可控制,故需要使用该方法自行判断当前操作是否还需要继续调用,若无视该方法的返回,其相应的执行方法依然能正常执行
Copyright © 2024. All rights reserved.