我需要将列为Y / N的xml中的元素映射到布尔值(真/假)。
xml中的元素之一是:
<parent_node> <due_override_flag>N</due_override_flag> ...more elements </parent_node>
我需要将'N'/'Y'映射为布尔值false / true 这是我要映射到的类:
@JsonRootName("trailer_standard_loads")
@JsonIgnoreProperties(ignoreUnknown=true)
public class StandardLoad {
@JsonProperty("trailer_load_seq")
private Integer trailerLoadSeq;
private String createdBy;
private ZonedDateTime createdDt;
private String updatedBy;
private ZonedDateTime updatedDt;
@JsonProperty("due_override_flag")
private Boolean dueOverrideFlag;
}
我有标准的吸气剂和吸气剂。 我从文档中不了解如何映射Y = true; N =错误;
答案 0 :(得分:2)
在setter方法中添加该逻辑
This system is not registered with an entitlement server. You can use subscription-manager to register.
adding repo from: graphviz-rhel.repo
grabbing file graphviz-rhel.repo to /etc/yum.repos.d/graphviz-rhel.repo
repo saved to /etc/yum.repos.d/graphviz-rhel.repo