@@ -254,9 +254,7 @@ private static boolean addProperty(ObjectNode whereToAdd, String key, JsonNode v
254
254
public void addIdProperty (String name , String id ) {
255
255
if (id == null || id .isBlank ()) { return ; }
256
256
mergeIdIntoValue (id , this .properties .get (name ))
257
- .ifPresent (newValue -> {
258
- this .properties .set (name , newValue );
259
- });
257
+ .ifPresent (newValue -> this .properties .set (name , newValue ));
260
258
this .linkedTo .add (id );
261
259
this .notifyObservers ();
262
260
}
@@ -369,7 +367,7 @@ private static void checkFormatISO8601(String date) throws IllegalArgumentExcept
369
367
/**
370
368
* Adds a property with date time format. The property should match the ISO 8601
371
369
* date format.
372
- *
370
+ * <p>
373
371
* Same as {@link #addProperty(String, String)} but with internal check.
374
372
*
375
373
* @param key key of the property (e.g. datePublished)
@@ -424,7 +422,7 @@ public T setId(String id) {
424
422
if (IdentifierUtils .isValidUri (id )) {
425
423
this .id = id ;
426
424
} else {
427
- this .id = IdentifierUtils .encode (id ).get ( );
425
+ this .id = IdentifierUtils .encode (id ).orElse ( this . id );
428
426
}
429
427
}
430
428
return self ();
@@ -461,7 +459,7 @@ public T addTypes(Collection<String> types) {
461
459
/**
462
460
* Adds a property with date time format. The property should match the ISO 8601
463
461
* date format.
464
- *
462
+ * <p>
465
463
* Same as {@link #addProperty(String, String)} but with internal check.
466
464
*
467
465
* @param key key of the property (e.g. datePublished)
@@ -521,7 +519,7 @@ public T addProperty(String key, boolean value) {
521
519
/**
522
520
* ID properties are often used when referencing other entities within
523
521
* the ROCrate. This method adds automatically such one.
524
- *
522
+ * <p>
525
523
* Instead of {@code "name": "id" }
526
524
* this will add {@code "name" : {"@id": "id"} }
527
525
*
0 commit comments