package net.ranides.assira.ui.model;

import lombok.Data;

@Data
public class CssBorderSize {

    public static final CssBorderSize NONE = new CssBorderSize(1, 1, 1, 1);

    public static final CssBorderSize SINGLE = new CssBorderSize(1, 1, 1, 1);

    public static final CssBorderSize DOUBLE = new CssBorderSize(2, 2, 2, 2);

    private final int top;
    private final int left;
    private final int bottom;
    private final int right;

    public boolean isSimple() {
        return top == left && top == bottom && top == right;
    }

    public int getSize() {
        if (!isSimple()) {
            throw new IllegalArgumentException("This type of border requires simple border size");
        }
        return left;
    }
}
