All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.castled.schema.models.Field Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package io.castled.schema.models;

import io.castled.schema.exceptions.SchemaValidationException;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Map;

@NoArgsConstructor
@Getter
@Setter
public class Field {

    private String name;
    private Schema schema;
    private Object value;
    private Map params;

    public Field(FieldSchema fieldSchema, Object value) throws SchemaValidationException {
        this.schema = fieldSchema.getSchema();
        this.name = fieldSchema.getName();
        this.value = value;
        this.params = fieldSchema.getParams();
        schema.validateValue(fieldSchema.getName(), value);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy