以下是我的.yml文件:
seqControl:
seqName: ISL
initialSequence: 1
flagIndicator:
M: true
O: false
在flagIndicator是一个映射的情况下,我无法将同一映射添加到我的配置类中:
@Component
@ConfigurationProperties("seqControl")
public class SequenceControlConfig {
private String seqName;
private int initialSequence;
private Map<String,Boolean> flagIndicator;
public Map<String, Boolean> getFlagIndicator() {
return flagIndicator;
}
public void setFlagIndicator(Map<String, Boolean> flagIndicator) {
this.flagIndicator = flagIndicator;
}
public String getSeqName() {
return seqName;
}
public void setSeqName(String seqName) {
this.seqName = seqName;
}
public int getInitialSequence() {
return initialSequence;
}
public void setInitialSequence(int initialSequence) {
this.initialSequence = initialSequence;
}
}
但是当我尝试将地图打印到同一类(在setter中)时,我得到的是空值。
我希望地图{M = true,O = false}。
请告诉我我要去哪里了