Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,38 +72,34 @@ static boolean isManual(PropertyMetadata metadata) {
* 属性读写模式
*/
interface AccessMode {
String id = "accessMode";
String id = "type";

//读
String read = "r";
String read = "read";
//写
String write = "w";
String write = "write";
//上报
String report = "u";
String report = "report";

static boolean isRead(PropertyMetadata property) {
return property
.getExpand(id)
.map(val -> val.toString().contains(read))
.orElse(true);
.orElse(false);
}

static boolean isWrite(PropertyMetadata property) {
return property
.getExpand(id)
.map(val -> val.toString().contains(write))
.orElseGet(() -> property
.getExpand("readOnly")
.map(readOnly -> !CastUtils.castBoolean(readOnly))
.orElse(true)
);
.orElse(false);
}

static boolean isReport(PropertyMetadata property) {
return property
.getExpand(id)
.map(val -> val.toString().contains(report))
.orElse(true);
.orElse(false);
}
}

Expand Down