package com.xydl.model; import com.fasterxml.jackson.annotation.JsonProperty; import com.xydl.entity.SyncFieldsInfo; import lombok.Data; import java.util.Map; @Data public class AttributeItem { @JsonProperty("AttributeCode") String attributeCode; @JsonProperty("DataValue") Object dataValue; public static AttributeItem fromData(Map map, SyncFieldsInfo field) { Object value = map.get(field.getFieldName()); if (value != null) { AttributeItem root = new AttributeItem(); root.setAttributeCode(field.getDestFieldName()); root.setDataValue(value); return root; } else { return null; } } }