@Test public void canGetMapPhases() { MantaJobPhase phase1 = new MantaJobPhase().setType("map").setExec("echo 1"); MantaJobPhase phase2 = new MantaJobPhase().setType("map").setExec("echo 2"); MantaJobPhase phase3 = new MantaJobPhase().setType("reduce").setExec("echo 3"); List<MantaJobPhase> phases = new ArrayList<>(); phases.add(phase1); phases.add(phase2); phases.add(phase3); MantaJob job = new MantaJob("test job", phases); List<MantaJobPhase> mapPhases = job.getMapPhases(); Assert.assertEquals(mapPhases.get(0), phase1); Assert.assertEquals(mapPhases.get(1), phase2); }
@JsonIgnore public List<MantaJobPhase> getMapPhases() { try (Stream<MantaJobPhase> stream = phases.stream() .filter(p -> p.getType().equals("map"))) { return stream.collect(Collectors.toCollection(ArrayList::new)); } }
MantaJob { @JsonIgnore public List<MantaJobPhase> getMapPhases() { try (Stream<MantaJobPhase> stream = phases.stream() .filter(p -> p.getType().equals("map"))) { return stream.collect(Collectors.toCollection(ArrayList::new)); } } }
MantaJob { @JsonIgnore public List<MantaJobPhase> getMapPhases() { try (Stream<MantaJobPhase> stream = phases.stream() .filter(p -> p.getType().equals("map"))) { return stream.collect(Collectors.toCollection(ArrayList::new)); } } MantaJob();  MantaJob(final String name, final List<MantaJobPhase> phases); }
MantaJob { @JsonIgnore public List<MantaJobPhase> getMapPhases() { try (Stream<MantaJobPhase> stream = phases.stream() .filter(p -> p.getType().equals("map"))) { return stream.collect(Collectors.toCollection(ArrayList::new)); } } MantaJob();  MantaJob(final String name, final List<MantaJobPhase> phases); UUID getId(); String getName(); String getState(); Boolean getTransient(); Map<String, Number> getStats(); Instant getTimeArchiveStarted(); Instant getTimeArchiveDone(); Map<String, Object> getOptions(); Boolean getCancelled(); Boolean getInputDone(); Instant getTimeCreated(); Instant getTimeDone(); List<MantaJobPhase> getPhases(); @JsonIgnore List<MantaJobPhase> getMapPhases(); @JsonIgnore List<MantaJobPhase> getReducePhases(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
MantaJob { @JsonIgnore public List<MantaJobPhase> getMapPhases() { try (Stream<MantaJobPhase> stream = phases.stream() .filter(p -> p.getType().equals("map"))) { return stream.collect(Collectors.toCollection(ArrayList::new)); } } MantaJob();  MantaJob(final String name, final List<MantaJobPhase> phases); UUID getId(); String getName(); String getState(); Boolean getTransient(); Map<String, Number> getStats(); Instant getTimeArchiveStarted(); Instant getTimeArchiveDone(); Map<String, Object> getOptions(); Boolean getCancelled(); Boolean getInputDone(); Instant getTimeCreated(); Instant getTimeDone(); List<MantaJobPhase> getPhases(); @JsonIgnore List<MantaJobPhase> getMapPhases(); @JsonIgnore List<MantaJobPhase> getReducePhases(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }