add pattern

This commit is contained in:
Besok
2019-10-24 20:56:09 +01:00
parent 20b4195fb2
commit 630532cdda
14 changed files with 320 additions and 53 deletions
@@ -1,4 +1,27 @@
package com.iluwatar.roleobject;
public class InvestorRole extends CustomerRole{
public class InvestorRole extends CustomerRole {
private String name;
private long amountToInvest;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getAmountToInvest() {
return amountToInvest;
}
public void setAmountToInvest(long amountToInvest) {
this.amountToInvest = amountToInvest;
}
public String invest() {
return String.join(" ",
"Investor", name, "has invested", String.valueOf(amountToInvest), "dollars");
}
}