File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/edu/kit/datamanager/ro_crate/entities/data Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 99
1010import java .util .HashSet ;
1111import java .util .Set ;
12+ import java .util .stream .Collectors ;
1213
1314/**
1415 * A helping class for the creating of Data entities of type Dataset.
@@ -35,7 +36,9 @@ public class DataSetEntity extends DataEntity {
3536 */
3637 public DataSetEntity (AbstractDataSetBuilder <?> entityBuilder ) {
3738 super (entityBuilder );
38- this .hasPart = entityBuilder .hasPart ;
39+ this .hasPart = entityBuilder .hasPart .stream ()
40+ .filter (s -> !s .isBlank ())
41+ .collect (Collectors .toSet ());
3942 this .addType (TYPE );
4043 }
4144
@@ -44,7 +47,9 @@ public void removeFromHasPart(String str) {
4447 }
4548
4649 public void addToHasPart (String id ) {
47- this .hasPart .add (id );
50+ if (id != null && !id .isEmpty ()) {
51+ this .hasPart .add (id );
52+ }
4853 }
4954
5055 /**
You can’t perform that action at this time.
0 commit comments