Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliviagallucci/49fc6d696a8732192a281cdbc70147d6 to your computer and use it in GitHub Desktop.
Save oliviagallucci/49fc6d696a8732192a281cdbc70147d6 to your computer and use it in GitHub Desktop.
/**
* Creates account entity according to provided authentication
*
* @param lastname: account user's lastname
* @param firstname: account user's firstname
* @param phonenumber: account user's phone number
* @param username: account username
* @param password: account password provided as json object
* @return Account: returns itself as object
*/
public Account(@JsonProperty("LastName") String lastname,
@JsonProperty("FirstName") String firstname,
@JsonProperty("PhoneNumber") String phonenumber,
@JsonProperty("Username") String username,
@JsonProperty("Password") String password) {
this.lastname = lastname;
this.firstname = firstname;
this.phonenumber = phonenumber;
this.username = username;
this.password = password;
this.role = (this.username.equals("admin")) ? 0 : 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment