package com.cisdi.data.AMETEKSurfaceVision;

import java.util.ArrayList;
import java.util.List;

/**
 * 实例点位信息
 *
 * @author tzz
 */
public class DynamicCodeActionParamDTO {
    public enum PropertyType {
        BYTE,
        BOOLEAN,
        SHORT,
        INT,
        FLOAT,
        DOUBLE,
        STRING,
        LONG,
        PLACEHOLDER;
    }

    private List<PropertyConfig> propertyList;

    public void appendProperty(PropertyConfig propertyConfig) {

        if (propertyConfig == null) {
            return;
        }

        if (propertyList == null) {
            propertyList = new ArrayList<>();
        }
        propertyList.add(propertyConfig);
    }

    public static class PropertyConfig{

        /** 属性Id*/
        private String propertyId;

        /** 属性类型*/
        private PropertyType propertyType;

        /**长度*/
        private Integer length;

        public String getPropertyId() {
            return propertyId;
        }

        public void setPropertyId(String propertyId) {
            this.propertyId = propertyId;
        }

        public PropertyType getPropertyType() {
            return propertyType;
        }

        public void setPropertyType(PropertyType propertyType) {
            this.propertyType = propertyType;
        }

        public Integer getLength() {
            return length;
        }

        public void setLength(Integer length) {
            this.length = length;
        }

        @Override
        public String toString() {
            return "PropertyConfig{" +
                "propertyId='" + propertyId + '\'' +
                ", propertyType=" + propertyType +
                ", length=" + length +
                '}';
        }
    }

    public List<PropertyConfig> getPropertyList() {
        return propertyList;
    }

    public void setPropertyList(List<PropertyConfig> propertyList) {
        this.propertyList = propertyList;
    }

    @Override
    public String toString() {
        return "DynamicCodeActionParamDTO{" +
            "propertyList=" + propertyList +
            '}';
    }

}
