From f93b81f548845874bc873c25bddc03397c113776 Mon Sep 17 00:00:00 2001 From: Hknots Date: Tue, 12 Nov 2024 00:57:18 +0100 Subject: [PATCH] remove identifikators as field variable --- generate/java/java_class_tpl.go | 7 ++----- generate/java/java_resource_class_tpl.go | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/generate/java/java_class_tpl.go b/generate/java/java_class_tpl.go index 23c5b2e..ce8d5d5 100644 --- a/generate/java/java_class_tpl.go +++ b/generate/java/java_class_tpl.go @@ -69,7 +69,8 @@ public {{- if .Abstract }} abstract {{- end }} class {{ .Name }} {{ if .Extends {{- if .Identifiable }} @JsonIgnore - private Map createIdentifikators() { + @Override + private Map getIdentifikators() { Map identifikators = new HashMap<>(); {{- if .ExtendsIdentifiable}} @@ -112,10 +113,6 @@ public {{- if .Abstract }} abstract {{- end }} class {{ .Name }} {{ if .Extends @JsonIgnore private final List relations = createRelations(); {{- end }} -{{- if .Identifiable }} - @JsonIgnore - private final Map identifikators = createIdentifikators(); -{{- end }} {{- if .Attributes }} {{- range $att := .Attributes }} {{- if $att.Deprecated }} diff --git a/generate/java/java_resource_class_tpl.go b/generate/java/java_resource_class_tpl.go index c3367c0..9777698 100644 --- a/generate/java/java_resource_class_tpl.go +++ b/generate/java/java_resource_class_tpl.go @@ -72,10 +72,8 @@ public {{- if .Abstract }} abstract {{- end }} class {{ .Name }}Resource {{ if . {{- if .Identifiable }} @JsonIgnore - private final Map identifikators = createIdentifikators(); - - @JsonIgnore - private Map createIdentifikators() { + @Override + private Map getIdentifikators() { Map identifikators = new HashMap<>(); {{- if .ExtendsIdentifiable}} @@ -90,7 +88,6 @@ public {{- if .Abstract }} abstract {{- end }} class {{ .Name }}Resource {{ if . return Collections.unmodifiableMap(identifikators); } - {{- end }} // Relations