public void check(Complex thing, boolean fix) { Set<PhysicalEntity> ents = thing.getComponent(); if (ents != null) { Collection<String> diffLocs = new HashSet<String>(); PhysicalEntity ref = thing; for (PhysicalEntity e : ents) { if(ref.getCellularLocation()==null && e.getCellularLocation() != null) { ref = e; continue; } if (e.getCellularLocation() != null && !ref.getCellularLocation().isEquivalent(e.getCellularLocation())) { diffLocs.add(e + " " + e.getCellularLocation()); } } if(!diffLocs.isEmpty()) { error(thing, "component.different.location", false, thing.getCellularLocation() + "", diffLocs); } } }
public void check(final Validation validation, Complex thing) { Set<PhysicalEntity> ents = thing.getComponent(); if (ents != null) { Collection<String> diffLocs = new HashSet<String>(); PhysicalEntity ref = thing; for (PhysicalEntity e : ents) { if(ref.getCellularLocation()==null && e.getCellularLocation() != null) { ref = e; continue; } if (e.getCellularLocation() != null && !ref.getCellularLocation().isEquivalent(e.getCellularLocation())) { diffLocs.add(e + " " + e.getCellularLocation()); } } if(!diffLocs.isEmpty()) { error(validation, thing, "component.different.location", false, thing.getCellularLocation() + "", diffLocs); } } }