package miniloan;
import [Link];
import [Link];
import [Link];
import [Link];
@XmlAccessorType([Link])
public class Borrower {
@XmlElement
private String name;
@XmlElement
private int creditScore;
@XmlElement
private int yearlyIncome;
public Borrower() {
}
public Borrower(@BusinessName("name") String name, @BusinessName("creditScore")
int creditScore, @BusinessName("yearlyIncome") int yearlyIncome) {
this();
[Link] = name;
[Link] = creditScore;
[Link] = yearlyIncome;
}
public String getName() {
return [Link];
}
public void setName(String n) {
[Link] = n;
}
public int getCreditScore() {
return [Link];
}
public void setCreditScore(int creditScore) {
[Link] = creditScore;
}
public int getYearlyIncome() {
return [Link];
}
public void setYearlyIncome(int yearlyIncome) {
[Link] = yearlyIncome;
}
}
package miniloan;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@XmlAccessorType([Link])
public class Loan {
@XmlElement
private int amount;
@XmlElement
private int duration;
private double yearlyInterestRate;
private int yearlyRepayment;
private boolean approved;
private Collection<String> messages;
public Loan() {
[Link] = new ArrayList();
[Link] = true;
}
@CustomProperty(
name = "[Link]",
value = "true"
)
public Loan(@BusinessName("amount") int amount, @BusinessName("duration") int
duration, @BusinessName("yearlyInterestRate") double yearlyInterestRate) {
this();
[Link] = amount;
[Link] = duration;
[Link] = yearlyInterestRate;
}
public int getAmount() {
return [Link];
}
public void setAmount(int a) {
[Link] = a;
}
@CustomProperty(
name = "[Link]",
value = "true"
)
public boolean isApproved() {
return [Link];
}
public String getApprovalStatus() {
return [Link]([Link]) + " " + [Link]();
}
public void setApproved(boolean approved) {
[Link] = approved;
}
public void reject() {
[Link] = false;
}
public int getDuration() {
return [Link];
}
public void setDuration(int d) {
[Link] = d;
}
public double getYearlyInterestRate() {
return [Link];
}
public void setYearlyInterestRate(double rate) {
[Link] = rate;
}
public Collection<String> getMessages() {
return [Link];
}
public void removeFromMessages(String argument) {
[Link](argument);
}
public void addToMessages(String argument) {
[Link](argument);
}
public int getYearlyRepayment() {
if ([Link] == 0 && [Link] != 0.0D &&
[Link] != 0) {
[Link] = [Link]();
}
return [Link];
}
private int computeYearlyRepayment() {
double i = [Link] / 12.0D;
double p = i * (double)[Link] / (1.0D - [Link](1.0D + i, (double)(-
[Link])));
return (int)(p * 12.0D);
}
}