mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 14:59:21 +00:00
add pattern
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user