@@ -254,9 +254,7 @@ private static boolean addProperty(ObjectNode whereToAdd, String key, JsonNode v
254254 public void addIdProperty (String name , String id ) {
255255 if (id == null || id .isBlank ()) { return ; }
256256 mergeIdIntoValue (id , this .properties .get (name ))
257- .ifPresent (newValue -> {
258- this .properties .set (name , newValue );
259- });
257+ .ifPresent (newValue -> this .properties .set (name , newValue ));
260258 this .linkedTo .add (id );
261259 this .notifyObservers ();
262260 }
@@ -369,7 +367,7 @@ private static void checkFormatISO8601(String date) throws IllegalArgumentExcept
369367 /**
370368 * Adds a property with date time format. The property should match the ISO 8601
371369 * date format.
372- *
370+ * <p>
373371 * Same as {@link #addProperty(String, String)} but with internal check.
374372 *
375373 * @param key key of the property (e.g. datePublished)
@@ -424,7 +422,7 @@ public T setId(String id) {
424422 if (IdentifierUtils .isValidUri (id )) {
425423 this .id = id ;
426424 } else {
427- this .id = IdentifierUtils .encode (id ).get ( );
425+ this .id = IdentifierUtils .encode (id ).orElse ( this . id );
428426 }
429427 }
430428 return self ();
@@ -461,7 +459,7 @@ public T addTypes(Collection<String> types) {
461459 /**
462460 * Adds a property with date time format. The property should match the ISO 8601
463461 * date format.
464- *
462+ * <p>
465463 * Same as {@link #addProperty(String, String)} but with internal check.
466464 *
467465 * @param key key of the property (e.g. datePublished)
@@ -521,7 +519,7 @@ public T addProperty(String key, boolean value) {
521519 /**
522520 * ID properties are often used when referencing other entities within
523521 * the ROCrate. This method adds automatically such one.
524- *
522+ * <p>
525523 * Instead of {@code "name": "id" }
526524 * this will add {@code "name" : {"@id": "id"} }
527525 *
0 commit comments