Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
0cae1bac
by Tony CHEMIT at 2018-09-18T01:46:58Z
1 changed file:
Changes:
| ... | ... | @@ -28,6 +28,8 @@ import fr.ird.observe.dto.data.seine.NonTargetCatchReference; |
| 28 | 28 |
import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 29 | 29 |
import fr.ird.observe.entities.seine.NonTargetCatch;
|
| 30 | 30 |
|
| 31 |
+import java.util.Optional;
|
|
| 32 |
+ |
|
| 31 | 33 |
/**
|
| 32 | 34 |
* Created on 24/11/15.
|
| 33 | 35 |
*
|
| ... | ... | @@ -41,9 +43,8 @@ public class NonTargetCatchEntityReferenceBinder extends DataEntityReferenceBind |
| 41 | 43 |
|
| 42 | 44 |
@Override
|
| 43 | 45 |
public NonTargetCatchReference toReference(ReferentialLocale referentialLocale, NonTargetCatch entity) {
|
| 44 |
- |
|
| 45 | 46 |
return new NonTargetCatchReference(entity, entity.getSpecies().getScientificLabel(),
|
| 46 |
- entity.getSpeciesFate().getLabel(referentialLocale));
|
|
| 47 |
+ Optional.ofNullable(entity.getSpeciesFate()).map(e->e.getLabel(referentialLocale)).orElse(null));
|
|
| 47 | 48 |
|
| 48 | 49 |
}
|
| 49 | 50 |
}
|