You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
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<String, Object> 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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|