MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / fillPosition

Method fillPosition

reflection/Staff.java:23–32  ·  view source on GitHub ↗
(String title, Person hire)

Source from the content-addressed store, hash-verified

21 return false;
22 }
23 public void fillPosition(String title, Person hire) {
24 for(Position position : this)
25 if(position.getTitle().equals(title) &&
26 position.getPerson().empty) {
27 position.setPerson(hire);
28 return;
29 }
30 throw new RuntimeException(
31 "Position " + title + " not available");
32 }
33 public static void main(String[] args) {
34 Staff staff = new Staff("President", "CTO",
35 "Marketing Manager", "Product Manager",

Callers 1

mainMethod · 0.95

Calls 4

getTitleMethod · 0.80
getPersonMethod · 0.80
setPersonMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected