File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,37 +16,10 @@ import java.util.stream.Stream;
1616 */
1717public class OpenMINDS {
1818
19- private final OpenMINDSContext context;
19+ private OpenMINDS(){}
2020
21- private OpenMINDS(OpenMINDSContext context){
22- this.context = context;
23- }
24-
25- private static void persist(String targetDirectory, Stream<Instance > instances){
26- File dir = new File(targetDirectory);
27- if(!dir.exists()){
28- dir.mkdirs();
29- }
30- instances.forEach(i -> {
31- File f = new File(targetDirectory+File.separator+i.getLocalId().id()+".jsonld");
32- try {
33- ParsingUtils.OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValue(f, i);
34- } catch (IOException e) {
35- throw new RuntimeException(e);
36- }
37- });
38- }
39-
40- {% for version in relevant_versions %} public static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}(){
41- return {{version}}(OpenMINDSContext.defaultContext());
42- }
43-
44- public static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}(String idPrefix){
45- return {{version}}(new OpenMINDSContext(idPrefix, true));
46- }
47-
48- private static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}(OpenMINDSContext context) {
49- return new OpenMINDS(context).new {{version[0] |upper}}{{version[1:] }}();
21+ {% for version in relevant_versions %} public static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}() {
22+ return new OpenMINDS().new {{version[0] |upper}}{{version[1:] }}();
5023 }
5124
5225 public final class {{version[0] |upper}}{{version[1:] }} {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public class {{ class_name }} extends Instance {% if implemented_interfaces %}im
4444
4545 public {{ class_name }} build(OpenMINDSContext context) {
4646 if ({{ class_name }}.this.id == null) {
47- {{ class_name }}.this.id = InstanceId.withPrefix(UUID.randomUUID().toString(), openMINDSContext .idPrefix());
47+ {{ class_name }}.this.id = InstanceId.withPrefix(UUID.randomUUID().toString(), context .idPrefix());
4848 }
4949 {{ class_name }}.this.type = SEMANTIC_NAME;
5050 return {{ class_name }}.this;
You can’t perform that action at this time.
0 commit comments