I'm curious whether checking for null
is redundant in this concrete example.
public LoginJob(@NotNull String login, @NotNull String password) {
super(new Params(Priority.NORMAL).requireNetwork().persist());
Preconditions.checkNotNull(login, "login is null or empty");
Preconditions.checkNotNull(password, "password is null or empty");
this.login = login;
this.password = password;
}
Please notice I'm using Contract Annotator from JetBrains, so the User of a Class warned the LoginJob
constructor can't take null
values, it can't prevent him/her of doing so though.