Commit 06769f5c authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added restrictions for dns2/dns2-v6

parent 8ab6d808
......@@ -38,6 +38,11 @@ public class Preferences extends com.frostnerd.utils.preferences.Preferences {
PreferencesRestrictionBuilder builder = new PreferencesRestrictionBuilder();
builder.key("dns1").ofType(Type.STRING).shouldNotBe(null).always().shouldNotBe("").always().shouldBeLike(Util.ipv4WithPort).always().doneWithKey();
builder.key("dns1-v6").ofType(Type.STRING).shouldNotBe(null).always().shouldNotBe("").always().shouldBeLike(Util.ipv6WithPort).always().doneWithKey();
builder.key("dns2").ofType(Type.STRING).shouldNotBe(null).always().shouldBeLike(Util.ipv4WithPort)
.whenToStringIsNotEmpty().doneWithKey();
builder.key("dns2-v6").ofType(Type.STRING).shouldNotBe(null).always().shouldBeLike(Util.ipv4WithPort)
.whenToStringIsNotEmpty().doneWithKey();
builder.key("setting_ipv6_enabled").ofType(Type.BOOLEAN).shouldNotBe(false).when(new PreferenceRestriction.Condition() {
@Override
public boolean isMet(@NonNull com.frostnerd.utils.preferences.Preferences preferences, @NonNull String key, @Nullable Object newValue) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment