docs: update role object (#2961)

This commit is contained in:
Ilkka Seppälä
2024-05-19 13:33:42 +03:00
committed by GitHub
parent f7c00f2b16
commit 3297eb42a0
4 changed files with 148 additions and 63 deletions
@@ -24,21 +24,18 @@
*/
package com.iluwatar.roleobject;
import lombok.Getter;
import lombok.Setter;
/**
* Borrower role.
*/
@Getter
@Setter
public class BorrowerRole extends CustomerRole {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String borrow() {
return String.format("Borrower %s wants to get some money.", name);
}
@@ -24,31 +24,20 @@
*/
package com.iluwatar.roleobject;
import lombok.Getter;
import lombok.Setter;
/**
* Investor role.
*/
@Getter
@Setter
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.format("Investor %s has invested %d dollars", name, amountToInvest);
}