use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingActivityWithIdentifiers in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBean method addToIdsList.
private void addToIdsList(List<FaIdsListWithTripIdMap> responseList, FishingActivityEntity faEntity) {
Set<FishingTripIdentifierEntity> fishingTripIdentifiers = faEntity.getFishingTrips().iterator().next().getFishingTripIdentifiers();
List<FishingActivityWithIdentifiers> faIdentifiers = mapToActivityIdsAndType(faEntity.getFishingActivityIdentifiers(), faEntity.getTypeCode());
for (FishingTripIdentifierEntity tripIdentifEntity : fishingTripIdentifiers) {
FaIdsListWithTripIdMap existingActWithIdentifiers = getElementWithTripId(responseList, tripIdentifEntity.getTripId());
if (null != existingActWithIdentifiers) {
existingActWithIdentifiers.getFaIdentifierLists().addAll(faIdentifiers);
} else {
responseList.add(new FaIdsListWithTripIdMap(tripIdentifEntity.getTripId(), tripIdentifEntity.getTripSchemeId(), faIdentifiers));
}
}
}
Aggregations