package ru.kirillius.pf.sdn.api.properties;

import lombok.Builder;
import lombok.Getter;

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

@Getter
@Builder
public class PropertyDescriptor {
    private PropertyDescriptor(PropertyType type, boolean array, Object defaultValue, boolean required) {
        this.type = type;
        this.array = array;
        this.defaultValue = defaultValue;
        this.required = required;
    }

    public PropertyDescriptor addConstraint(PropertyConstraint constraint) {
        constraints.add(constraint);
        return this;
    }

    private final List<PropertyConstraint> constraints = new ArrayList<>();
    private final PropertyType type;
    private final boolean array;
    private final Object defaultValue;
    private final boolean required;
}
