AuthMe / ConfigMe

A simple configuration management library for any Java project!
MIT License
37 stars 16 forks source link

Int property within range #330

Open ljacqu opened 1 year ago

ljacqu commented 1 year ago

I might want to have an int property that can only be, for example, between 0 and 10. It would be nice to just let ConfigMe handle it and to be sure that the value is within the range.

gamerover98 commented 1 year ago

Yeah, it can be done for all other numeric types! For example, FloatProperty with a range like:

public class FrequencyProperty extends/implements FloatProperty {
    @Override
    public float maxValue() {
        return 1.0F;
    }

    @Override
    public float minValue() {
        return -1.0F;
    }
}