-
-
Save XakepSDK/a78245b262315437d2800be524018d2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dk.xakeps.truestarter.server.dto.request; | |
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import dk.xakeps.truestarter.server.validator.CrossField; | |
import javax.annotation.Nonnull; | |
import javax.validation.constraints.Email; | |
import javax.validation.constraints.NotNull; | |
import javax.validation.constraints.Size; | |
@CrossField(fields = {"password", "passwordRetry"}) | |
public class RegisterRequest { | |
@NotNull | |
@Size(max = 150) | |
private final String email; | |
@NotNull | |
@Size(min = 3, max = 16) | |
private final String username; | |
@NotNull | |
@Size(min = 6, max = 32) | |
private final String password; | |
@NotNull | |
@Size(min = 6, max = 32) | |
private final String passwordRetry; | |
@JsonCreator | |
public RegisterRequest(@Nonnull @JsonProperty("email") String email, | |
@Nonnull @JsonProperty("username") String username, | |
@Nonnull @JsonProperty("password") String password, | |
@Nonnull @JsonProperty("passwordRetry") String passwordRetry) { | |
this.email = email; | |
this.username = username; | |
this.password = password; | |
this.passwordRetry = passwordRetry; | |
} | |
public String getEmail() { | |
return email; | |
} | |
public String getUsername() { | |
return username; | |
} | |
public String getPassword() { | |
return password; | |
} | |
public String getPasswordRetry() { | |
return passwordRetry; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment