@Override public String apply(Computer computer) { computer.setClient(client); return computer.getDisplayName().toLowerCase(); } });
@Override public Computer apply(Computer computer) { computer.setClient(client); return computer; } }
/** * Get a list of all the computers on the server (at the summary level) * * @return list of defined computers (summary level, for details @see Computer#details * @throws IOException */ public Map<String, Computer> getComputers() throws IOException { List<Computer> computers = client.get("computer/", Computer.class).getComputers(); return Maps.uniqueIndex(computers, new Function<Computer, String>() { @Override public String apply(Computer computer) { computer.setClient(client); return computer.getDisplayName().toLowerCase(); } }); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((actions == null) ? 0 : actions.hashCode()); result = prime * result + ((displayName == null) ? 0 : displayName.hashCode()); result = prime * result + ((executors == null) ? 0 : executors.hashCode()); result = prime * result + ((idle == null) ? 0 : idle.hashCode()); result = prime * result + ((jnlp == null) ? 0 : jnlp.hashCode()); result = prime * result + ((launchSupported == null) ? 0 : launchSupported.hashCode()); result = prime * result + ((manualLaunchAllowed == null) ? 0 : manualLaunchAllowed.hashCode()); result = prime * result + ((monitorData == null) ? 0 : monitorData.hashCode()); result = prime * result + ((numExecutors == null) ? 0 : numExecutors.hashCode()); result = prime * result + ((offline == null) ? 0 : offline.hashCode()); result = prime * result + ((offlineCause == null) ? 0 : offlineCause.hashCode()); result = prime * result + ((offlineCauseReason == null) ? 0 : offlineCauseReason.hashCode()); result = prime * result + ((oneOffExecutors == null) ? 0 : oneOffExecutors.hashCode()); result = prime * result + ((temporarilyOffline == null) ? 0 : temporarilyOffline.hashCode()); return result; }
if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass())
@Test public void shouldReturnDetailOfComputer() throws Exception { Map<String, Computer> computers = server.getComputers(); assertTrue(computers.get("master").details().getDisplayName().equals("master")); }
@Override public Computer apply(Computer computer) { computer.setClient(client); return computer; } }
/** * Get a list of all the computers on the server (at the summary level) * * @return map of defined computers (summary level, for details @see * Computer#details * @throws IOException in case of an error. */ public Map<String, Computer> getComputers() throws IOException { List<Computer> computers = client.get("computer/", Computer.class).getComputers(); return Maps.uniqueIndex(computers, new Function<Computer, String>() { @Override public String apply(Computer computer) { computer.setClient(client); return computer.getDisplayName().toLowerCase(); } }); }
@Override public String apply(Computer computer) { computer.setClient(client); return computer.getDisplayName().toLowerCase(); } });