diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java index 7811fc0c..ead0d54d 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java @@ -27,12 +27,12 @@ public interface CommandInputParameter extends InputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java index 2f421b51..ad6601f5 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java @@ -35,15 +35,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -275,13 +275,13 @@ public CommandInputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -293,19 +293,14 @@ public CommandInputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -477,7 +472,7 @@ public CommandInputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.loadContents = (java.util.Optional) loadContents; this.loadListing = (java.util.Optional) loadListing; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java index 4dbff8dc..9ebbbcc9 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java @@ -27,12 +27,12 @@ public interface CommandOutputParameter extends OutputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java index c9408c81..66e3b3cf 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java @@ -35,15 +35,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -213,13 +213,13 @@ public CommandOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -231,19 +231,14 @@ public CommandOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -364,7 +359,7 @@ public CommandOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.type = (Object) type; this.outputBinding = (java.util.Optional) outputBinding; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java index a4182e3f..2a0041a6 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java @@ -26,12 +26,12 @@ public interface ExpressionToolOutputParameter extends OutputParameter, Saveable LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java index f4e71be9..06824072 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java @@ -34,15 +34,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -202,13 +202,13 @@ public ExpressionToolOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -220,19 +220,14 @@ public ExpressionToolOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -336,7 +331,7 @@ public ExpressionToolOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.type = (Object) type; for (String field:__doc.keySet()) { diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/IdentifierRequired.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/IdentifierRequired.java new file mode 100644 index 00000000..a4f0c7ad --- /dev/null +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/IdentifierRequired.java @@ -0,0 +1,28 @@ +// Copyright Common Workflow Language project contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.commonwl.cwlsdk.cwl1_2; + +import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions; +import org.commonwl.cwlsdk.cwl1_2.utils.Saveable; + +/** +* Auto-generated interface for https://w3id.org/cwl/cwl#IdentifierRequired
+ */ +public interface IdentifierRequired extends Identified, Saveable { + + java.util.Map getExtensionFields(); + LoadingOptions getLoadingOptions(); + +} diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java index 1d2ca926..f0b9f1c4 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java @@ -28,12 +28,12 @@ public interface OperationInputParameter extends InputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java index a0458165..a1fec743 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java @@ -36,15 +36,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -262,13 +262,13 @@ public OperationInputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -280,19 +280,14 @@ public OperationInputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -447,7 +442,7 @@ public OperationInputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.loadContents = (java.util.Optional) loadContents; this.loadListing = (java.util.Optional) loadListing; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java index 12532bd6..393cee4c 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java @@ -28,12 +28,12 @@ public interface OperationOutputParameter extends OutputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java index 84ff46b2..c1e93b04 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java @@ -36,15 +36,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -202,13 +202,13 @@ public OperationOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -220,19 +220,14 @@ public OperationOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -336,7 +331,7 @@ public OperationOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.type = (Object) type; for (String field:__doc.keySet()) { diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/Parameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/Parameter.java index da4df6f6..5eaf40c6 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/Parameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/Parameter.java @@ -22,7 +22,7 @@ Define an input or output parameter to a process. */ -public interface Parameter extends FieldBase, Documented, Identified, Saveable { +public interface Parameter extends FieldBase, Documented, IdentifierRequired, Saveable { java.util.Map getExtensionFields(); LoadingOptions getLoadingOptions(); diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java index 0683cc21..0ee8b872 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java @@ -26,12 +26,12 @@ public interface WorkflowInputParameter extends InputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java index 38d24ce4..777d9252 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java @@ -34,15 +34,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -274,13 +274,13 @@ public WorkflowInputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -292,19 +292,14 @@ public WorkflowInputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -476,7 +471,7 @@ public WorkflowInputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.loadContents = (java.util.Optional) loadContents; this.loadListing = (java.util.Optional) loadListing; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java index 20ec6de9..29946e46 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java @@ -34,12 +34,12 @@ public interface WorkflowOutputParameter extends OutputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java index 0b0f625e..f82c6ae7 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java @@ -42,15 +42,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -252,13 +252,13 @@ public WorkflowOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -270,19 +270,14 @@ public WorkflowOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -437,7 +432,7 @@ public WorkflowOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.outputSource = (Object) outputSource; this.linkMerge = (java.util.Optional) linkMerge; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java index 2e95bd90..d926748e 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java @@ -100,18 +100,18 @@ input object (or individual scatter job), and returns a boolean a subworkflow (recursive workflows are not allowed). */ -public interface WorkflowStep extends Identified, Labeled, Documented, Saveable { +public interface WorkflowStep extends IdentifierRequired, Labeled, Documented, Saveable { java.util.Map getExtensionFields(); LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStep/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this WorkflowStep. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java index 5b230f8c..dc06720e 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java @@ -114,15 +114,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStep/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this WorkflowStep. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -298,13 +298,13 @@ public WorkflowStepImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -316,19 +316,14 @@ public WorkflowStepImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -484,7 +479,7 @@ public WorkflowStepImpl( if (!__errors.isEmpty()) { throw new ValidationException("Trying 'RecordField'", __errors); } - this.id = (java.util.Optional) id; + this.id = (String) id; this.label = (java.util.Optional) label; this.doc = (Object) doc; this.in = (java.util.List) in; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java index 0b1368ac..aca1570d 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java @@ -129,18 +129,18 @@ sources are conditional, so null sources (from skipped steps) should be filtered out. */ -public interface WorkflowStepInput extends Identified, Sink, LoadContents, Labeled, Saveable { +public interface WorkflowStepInput extends IdentifierRequired, Sink, LoadContents, Labeled, Saveable { java.util.Map getExtensionFields(); LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepInput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the source input field name. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#source
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java index 57e8e93a..37743fd9 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java @@ -143,15 +143,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepInput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the source input field name. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -329,13 +329,13 @@ public WorkflowStepInputImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -347,19 +347,14 @@ public WorkflowStepInputImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; Object source; if (__doc.containsKey("source")) { @@ -499,7 +494,7 @@ public WorkflowStepInputImpl( if (!__errors.isEmpty()) { throw new ValidationException("Trying 'RecordField'", __errors); } - this.id = (java.util.Optional) id; + this.id = (String) id; this.source = (Object) source; this.linkMerge = (java.util.Optional) linkMerge; this.pickValue = (java.util.Optional) pickValue; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java index 4920b23e..ef1df393 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java @@ -29,16 +29,16 @@ parameter. The workflow parameter (given in the `id` field) be may be used to connect the output value to downstream parameters. */ -public interface WorkflowStepOutput extends Identified, Saveable { +public interface WorkflowStepOutput extends IdentifierRequired, Saveable { java.util.Map getExtensionFields(); LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepOutput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the workflow parameter to export. * */ - java.util.Optional getId(); + String getId(); } diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java index b81cf4b9..76ba950b 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java @@ -43,15 +43,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepOutput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the workflow parameter to export. * */ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -85,13 +85,13 @@ public WorkflowStepOutputImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -103,23 +103,18 @@ public WorkflowStepOutputImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; if (!__errors.isEmpty()) { throw new ValidationException("Trying 'RecordField'", __errors); } - this.id = (java.util.Optional) id; + this.id = (String) id; for (String field:__doc.keySet()) { if (!attrs.contains(field)) { if (field.contains(":")) { diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/ConstantMaps.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/ConstantMaps.java index bb2f3618..69b01fa3 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/ConstantMaps.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/ConstantMaps.java @@ -47,6 +47,7 @@ public class ConstantMaps { vocab.put("File", "File"); vocab.put("IOSchema", "https://w3id.org/cwl/cwl#IOSchema"); vocab.put("Identified", "https://w3id.org/cwl/cwl#Identified"); + vocab.put("IdentifierRequired", "https://w3id.org/cwl/cwl#IdentifierRequired"); vocab.put("InitialWorkDirRequirement", "InitialWorkDirRequirement"); vocab.put("InlineJavascriptRequirement", "InlineJavascriptRequirement"); vocab.put("InplaceUpdateRequirement", "InplaceUpdateRequirement"); @@ -190,6 +191,7 @@ public class ConstantMaps { rvocab.put("File", "File"); rvocab.put("https://w3id.org/cwl/cwl#IOSchema", "IOSchema"); rvocab.put("https://w3id.org/cwl/cwl#Identified", "Identified"); + rvocab.put("https://w3id.org/cwl/cwl#IdentifierRequired", "IdentifierRequired"); rvocab.put("InitialWorkDirRequirement", "InitialWorkDirRequirement"); rvocab.put("InlineJavascriptRequirement", "InlineJavascriptRequirement"); rvocab.put("InplaceUpdateRequirement", "InplaceUpdateRequirement"); diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/LoaderInstances.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/LoaderInstances.java index 0ac0025e..0f29e7cc 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/LoaderInstances.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/LoaderInstances.java @@ -54,6 +54,7 @@ public class LoaderInstances { public static Loader CWLVersion = new EnumLoader(CWLVersion.class); public static Loader Labeled = new RecordLoader(org.commonwl.cwlsdk.cwl1_2.Labeled.class, null, null); public static Loader Identified = new RecordLoader(org.commonwl.cwlsdk.cwl1_2.Identified.class, null, null); + public static Loader IdentifierRequired = new RecordLoader(org.commonwl.cwlsdk.cwl1_2.IdentifierRequired.class, null, null); public static Loader LoadListingEnum = new EnumLoader(LoadListingEnum.class); public static Loader LoadContents = new RecordLoader(org.commonwl.cwlsdk.cwl1_2.LoadContents.class, null, null); public static Loader FieldBase = new RecordLoader(org.commonwl.cwlsdk.cwl1_2.FieldBase.class, null, null); diff --git a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java index eef899cb..1fff5929 100644 --- a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java +++ b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java @@ -35,7 +35,7 @@ public void workflowStepInputSources() { WorkflowStep step1 = (WorkflowStep) workflow.getSteps().get(0); List inputs = step1.getIn(); WorkflowStepInput step1_input1 = (WorkflowStepInput) inputs.get(0); - Assert.assertEquals(workflow_id + "/step1/echo_in1", step1_input1.getId().get()); + Assert.assertEquals(workflow_id + "/step1/echo_in1", step1_input1.getId()); Assert.assertEquals(workflow_id + "/inp1", step1_input1.getSource()); } } diff --git a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java index 71a53283..911112f7 100644 --- a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java +++ b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java @@ -28,7 +28,7 @@ public void workflowInputSecFiles() { String workflow_id = workflow.getId().get(); List inputs = workflow.getInputs(); WorkflowInputParameter wf_file_input = (WorkflowInputParameter) inputs.get(1); - Assert.assertEquals(workflow_id + "/wf_file_input", wf_file_input.getId().get()); + Assert.assertEquals(workflow_id + "/wf_file_input", wf_file_input.getId()); List sec_files_l1 = (List) wf_file_input.getSecondaryFiles(); Assert.assertEquals(1, sec_files_l1.size()); @@ -36,7 +36,7 @@ public void workflowInputSecFiles() { Assert.assertEquals(".also", sec_files1.getPattern()); Assert.assertEquals(true, sec_files1.getRequired()); WorkflowInputParameter wf_file_input_array = (WorkflowInputParameter) inputs.get(2); - Assert.assertEquals(workflow_id + "/wf_file_input_array", wf_file_input_array.getId().get()); + Assert.assertEquals(workflow_id + "/wf_file_input_array", wf_file_input_array.getId()); List sec_files_l2 = (List) wf_file_input_array.getSecondaryFiles(); Assert.assertEquals(1, sec_files_l2.size());