Model example for a loan form
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
public class Loan { | |
// private attributes | |
private String name; | |
private String email; | |
private BigDecimal amount; | |
private int installments; | |
// constructor | |
public LoanData(String name, String email, BigDecimal amount, int installments) { | |
this.name = name; | |
this.email = email; | |
this.amount = amount; | |
this.installments = installments; | |
} | |
// getters and setters | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
// others getters and setters ignored (but they're necessary) | |
@Override | |
public String toString() { | |
return "Loan{ \"name='" + name + '\'' + | |
", email='" + email + '\'' + | |
", amount=" + amount + | |
", installments=" + installments + '}'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment