Created
June 6, 2017 04:01
-
-
Save gregturn/533241432672165bcca3bbc9b421a625 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Value | |
@JsonPropertyOrder({"id", "name", "employees"}) | |
class Supervisor { | |
@JsonIgnore | |
private final Manager manager; | |
public Long getId() { | |
return this.manager.getId(); | |
} | |
public String getName() { | |
return this.manager.getName(); | |
} | |
public List<String> getEmployees() { | |
return manager.getEmployees().stream() | |
.map(employee -> employee.getName() + "::" + employee.getRole()) | |
.collect(Collectors.toList()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment