A common data structure extension API for vrml library
<dependency>
<groupId>group.rxcloud</groupId>
<artifactId>vrml-data</artifactId>
<version>1.1.4</version>
</dependency>
You can impl those abilities to your data type.
Use Holdable to cache your lazy load data, then calculate and get it at the first time.
// define the class impl Holdable
private static class TestHoldable implements Holdable {
private Holder<Object> holder;
}
TestHoldable testHoldable = new TestHoldable();
// put a lazy load data in Holder
testHoldable.holder = new Holdable.Holder<>(() -> "str");
// get the lazy load data from Holder
testHoldable.holder.getData();
The data type can impl this interface, and then it can hold a trace map to tracing some data.
函数大致分为四种类型:
- 逻辑判断型
- 操作型
- 获取数据型
- 数值计算/处理型
EX:(返回函数的函数)
The return results of function operations are of the following types: operational/logical/...
This package defines the common results class for those operations.
// logical operation result
LogicalResult.success(); // success
LogicalResult.failure(); // failure
LogicalResult.unknown(); // unknown
// process operation result
ProcessResult.success(); // success
ProcessResult.success("obj"); // success with success result obj
ProcessResult.failure("str"); // failure with error message
ProcessResult.failure("str", "obj"); // failure with error message and failure result obj
ProcessResult.unknown("str"); // unknown with error message
ProcessResult.unknown("str", "obj"); // unknown with error message and unknown result obj
Check it out below:
import HoldableTest;
import LogicalResultTest;
import ProcessResultTest;
Developer repository can be found here.
<dependency>
<groupId>group.rxcloud</groupId>
<artifactId>vrml-data</artifactId>
<version>1.1.4</version>
</dependency>
A small number of users have reported problems building vrml. Read our contribution guide for details.