Android Library for validating values

80 Views Asked by At

I'm using Validation library called Android Saripaar v2

link => https://github.com/ragunathjawahar/android-saripaar

It has some features like this

    @NotEmpty // this line does the magic
    @BindView(R.id.saveTextButton)
    TextView saveTextButton;

// note that @BindView is from Butterknife

it works just fine, but i can only use this for validating ui elements, not simple values, such like

boolean isUserPhotoSetted; // this should be true

the approach that i'm taking currently is to add a different block that handles only boolean validation with if statement.

i believe that something like this would be possible.

@ShouldBeTrue
boolean isUserPhotoSetted;

@MatchValue(true)
boolean isUserPhotoSetted;

same content in link below. https://github.com/ragunathjawahar/android-saripaar/issues/200

would there be any libraries to do something like this??

0

There are 0 best solutions below