You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GFlags uses Validators to quickly resolve any ill-formatted flag value with an application crash and a useful message. The validators are defined similarly to defining a flag and the two stay close together.
Consider following syntax:
private static final Flag<Integer> angle = Flags.integer('angle')
.validate(new Validator<Integer>() {
@Override public boolean check(String flagName, Integer value) {
return value >=0 && value < 360;
}
});
Java 8:
private static final Flag<Integer> angle = Flags.integer('angle')
.validate((flagName, value) -> value >=0 && value < 360);
Activity
yin commentedon Aug 8, 2017
Done in v0.3.0-beta1
yin commentedon Aug 9, 2017
Missing tests, reopened