Skip to content

Instantly share code, notes, and snippets.

@gregturn
Created June 6, 2017 04:01
Show Gist options
  • Save gregturn/533241432672165bcca3bbc9b421a625 to your computer and use it in GitHub Desktop.
Save gregturn/533241432672165bcca3bbc9b421a625 to your computer and use it in GitHub Desktop.
@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