package ru.ulstu.odin.model;

import ru.ulstu.odin.model.annotation.OdinNumeric;

import java.lang.reflect.Field;

public class OdinNumericField extends OdinField {
    private final boolean positiveOnly;
    private final int precision;
    private final int scale;

    public OdinNumericField(Field field) {
        super(field, OdinFieldType.NUMERIC);
        this.positiveOnly = getValue(OdinNumeric.class, "positiveOnly", Boolean.class);
        this.precision = getValue(OdinNumeric.class, "precision", Integer.class);
        this.scale = getValue(OdinNumeric.class, "scale", Integer.class);
    }

    public boolean isPositiveOnly() {
        return positiveOnly;
    }

    public int getPrecision() {
        return precision;
    }

    public int getScale() {
        return scale;
    }
}
