code styles

This commit is contained in:
Efstratios Giannopoulos 2024-05-01 13:47:23 +03:00
parent 1474eda8b9
commit a591c66875
4 changed files with 49 additions and 51 deletions

View File

@ -1,14 +1,14 @@
package org.opencdmp.commons.types.externalfetcher; package org.opencdmp.commons.types.externalfetcher;
import org.opencdmp.service.externalfetcher.config.entities.ResultFieldsMappingConfiguration;
import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import org.opencdmp.service.externalfetcher.config.entities.ResultFieldsMappingConfiguration;
public class ResultFieldsMappingConfigurationEntity implements ResultFieldsMappingConfiguration { public class ResultFieldsMappingConfigurationEntity implements ResultFieldsMappingConfiguration {
private String code; private String code;
private String responsePath; private String responsePath;
public String getCode() { public String getCode() {
return code; return this.code;
} }
@XmlElement(name = "code") @XmlElement(name = "code")
@ -17,7 +17,7 @@ public class ResultFieldsMappingConfigurationEntity implements ResultFieldsMappi
} }
public String getResponsePath() { public String getResponsePath() {
return responsePath; return this.responsePath;
} }
@XmlElement(name = "responsePath") @XmlElement(name = "responsePath")

View File

@ -38,7 +38,7 @@ public class FieldSet {
private List<Field> fields; private List<Field> fields;
public String getId() { public String getId() {
return id; return this.id;
} }
public void setId(String id) { public void setId(String id) {
@ -46,7 +46,7 @@ public class FieldSet {
} }
public Integer getOrdinal() { public Integer getOrdinal() {
return ordinal; return this.ordinal;
} }
public void setOrdinal(Integer ordinal) { public void setOrdinal(Integer ordinal) {
@ -54,7 +54,7 @@ public class FieldSet {
} }
public String getNumbering() { public String getNumbering() {
return numbering; return this.numbering;
} }
public void setNumbering(String numbering) { public void setNumbering(String numbering) {
@ -62,7 +62,7 @@ public class FieldSet {
} }
public String getTitle() { public String getTitle() {
return title; return this.title;
} }
public void setTitle(String title) { public void setTitle(String title) {
@ -70,7 +70,7 @@ public class FieldSet {
} }
public String getDescription() { public String getDescription() {
return description; return this.description;
} }
public void setDescription(String description) { public void setDescription(String description) {
@ -78,7 +78,7 @@ public class FieldSet {
} }
public String getExtendedDescription() { public String getExtendedDescription() {
return extendedDescription; return this.extendedDescription;
} }
public void setExtendedDescription(String extendedDescription) { public void setExtendedDescription(String extendedDescription) {
@ -86,7 +86,7 @@ public class FieldSet {
} }
public String getAdditionalInformation() { public String getAdditionalInformation() {
return additionalInformation; return this.additionalInformation;
} }
public void setAdditionalInformation(String additionalInformation) { public void setAdditionalInformation(String additionalInformation) {
@ -94,7 +94,7 @@ public class FieldSet {
} }
public Multiplicity getMultiplicity() { public Multiplicity getMultiplicity() {
return multiplicity; return this.multiplicity;
} }
public void setMultiplicity(Multiplicity multiplicity) { public void setMultiplicity(Multiplicity multiplicity) {
@ -102,7 +102,7 @@ public class FieldSet {
} }
public Boolean getHasMultiplicity() { public Boolean getHasMultiplicity() {
return hasMultiplicity; return this.hasMultiplicity;
} }
public void setHasMultiplicity(Boolean hasMultiplicity) { public void setHasMultiplicity(Boolean hasMultiplicity) {
@ -110,7 +110,7 @@ public class FieldSet {
} }
public Boolean getHasCommentField() { public Boolean getHasCommentField() {
return hasCommentField; return this.hasCommentField;
} }
public void setHasCommentField(Boolean hasCommentField) { public void setHasCommentField(Boolean hasCommentField) {
@ -118,7 +118,7 @@ public class FieldSet {
} }
public List<Field> getFields() { public List<Field> getFields() {
return fields; return this.fields;
} }
public void setFields(List<Field> fields) { public void setFields(List<Field> fields) {

View File

@ -1,8 +1,8 @@
package org.opencdmp.model.persist.descriptiontemplatedefinition; package org.opencdmp.model.persist.descriptiontemplatedefinition;
import org.opencdmp.commons.validation.BaseValidator;
import gr.cite.tools.validation.ValidatorFactory; import gr.cite.tools.validation.ValidatorFactory;
import gr.cite.tools.validation.specification.Specification; import gr.cite.tools.validation.specification.Specification;
import org.opencdmp.commons.validation.BaseValidator;
import org.opencdmp.convention.ConventionService; import org.opencdmp.convention.ConventionService;
import org.opencdmp.errorcode.ErrorThesaurusProperties; import org.opencdmp.errorcode.ErrorThesaurusProperties;
import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@ -16,47 +16,47 @@ import java.util.List;
public class FieldSetPersist { public class FieldSetPersist {
private String id = null; private String id;
public static final String _id = "id"; public static final String _id = "id";
private Integer ordinal = null; private Integer ordinal;
public static final String _ordinal = "ordinal"; public static final String _ordinal = "ordinal";
private String numbering = null; private String numbering;
public static final String _numbering = "numbering"; public static final String _numbering = "numbering";
private String title = null; private String title;
public static final String _title = "title"; public static final String _title = "title";
private String description = null; private String description;
public static final String _description = "description"; public static final String _description = "description";
private String extendedDescription = null; private String extendedDescription;
public static final String _extendedDescription = "extendedDescription"; public static final String _extendedDescription = "extendedDescription";
private String additionalInformation = null; private String additionalInformation;
public static final String _additionalInformation = "additionalInformation"; public static final String _additionalInformation = "additionalInformation";
private MultiplicityPersist multiplicity = null; private MultiplicityPersist multiplicity;
public static final String _multiplicity = "multiplicity"; public static final String _multiplicity = "multiplicity";
private Boolean hasMultiplicity; private Boolean hasMultiplicity;
public static final String _hasMultiplicity = "hasMultiplicity"; public static final String _hasMultiplicity = "hasMultiplicity";
private Boolean hasCommentField = null; private Boolean hasCommentField;
private List<FieldPersist> fields = null; private List<FieldPersist> fields;
public static final String _fields = "fields"; public static final String _fields = "fields";
public String getId() { public String getId() {
return id; return this.id;
} }
public void setId(String id) { public void setId(String id) {
@ -64,7 +64,7 @@ public class FieldSetPersist {
} }
public Integer getOrdinal() { public Integer getOrdinal() {
return ordinal; return this.ordinal;
} }
public void setOrdinal(Integer ordinal) { public void setOrdinal(Integer ordinal) {
@ -72,7 +72,7 @@ public class FieldSetPersist {
} }
public String getNumbering() { public String getNumbering() {
return numbering; return this.numbering;
} }
public void setNumbering(String numbering) { public void setNumbering(String numbering) {
@ -80,7 +80,7 @@ public class FieldSetPersist {
} }
public String getTitle() { public String getTitle() {
return title; return this.title;
} }
public void setTitle(String title) { public void setTitle(String title) {
@ -88,7 +88,7 @@ public class FieldSetPersist {
} }
public String getDescription() { public String getDescription() {
return description; return this.description;
} }
public void setDescription(String description) { public void setDescription(String description) {
@ -96,7 +96,7 @@ public class FieldSetPersist {
} }
public String getExtendedDescription() { public String getExtendedDescription() {
return extendedDescription; return this.extendedDescription;
} }
public void setExtendedDescription(String extendedDescription) { public void setExtendedDescription(String extendedDescription) {
@ -104,7 +104,7 @@ public class FieldSetPersist {
} }
public String getAdditionalInformation() { public String getAdditionalInformation() {
return additionalInformation; return this.additionalInformation;
} }
public void setAdditionalInformation(String additionalInformation) { public void setAdditionalInformation(String additionalInformation) {
@ -112,7 +112,7 @@ public class FieldSetPersist {
} }
public MultiplicityPersist getMultiplicity() { public MultiplicityPersist getMultiplicity() {
return multiplicity; return this.multiplicity;
} }
public void setMultiplicity(MultiplicityPersist multiplicity) { public void setMultiplicity(MultiplicityPersist multiplicity) {
@ -120,7 +120,7 @@ public class FieldSetPersist {
} }
public Boolean getHasCommentField() { public Boolean getHasCommentField() {
return hasCommentField; return this.hasCommentField;
} }
public void setHasCommentField(Boolean hasCommentField) { public void setHasCommentField(Boolean hasCommentField) {
@ -128,7 +128,7 @@ public class FieldSetPersist {
} }
public List<FieldPersist> getFields() { public List<FieldPersist> getFields() {
return fields; return this.fields;
} }
public void setFields(List<FieldPersist> fields) { public void setFields(List<FieldPersist> fields) {
@ -136,7 +136,7 @@ public class FieldSetPersist {
} }
public Boolean getHasMultiplicity() { public Boolean getHasMultiplicity() {
return hasMultiplicity; return this.hasMultiplicity;
} }
public void setHasMultiplicity(Boolean hasMultiplicity) { public void setHasMultiplicity(Boolean hasMultiplicity) {
@ -169,19 +169,19 @@ public class FieldSetPersist {
return Arrays.asList( return Arrays.asList(
this.spec() this.spec()
.must(() -> !this.isEmpty(item.getId())) .must(() -> !this.isEmpty(item.getId()))
.failOn(FieldSetPersist._id).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._id}, LocaleContextHolder.getLocale())), .failOn(FieldSetPersist._id).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._id}, LocaleContextHolder.getLocale())),
this.spec() this.spec()
.must(() -> !this.isNull(item.getOrdinal())) .must(() -> !this.isNull(item.getOrdinal()))
.failOn(FieldSetPersist._ordinal).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._ordinal}, LocaleContextHolder.getLocale())), .failOn(FieldSetPersist._ordinal).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._ordinal}, LocaleContextHolder.getLocale())),
this.spec() this.spec()
.must(() -> !this.isEmpty(item.getNumbering())) .must(() -> !this.isEmpty(item.getNumbering()))
.failOn(FieldSetPersist._numbering).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._numbering}, LocaleContextHolder.getLocale())), .failOn(FieldSetPersist._numbering).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._numbering}, LocaleContextHolder.getLocale())),
this.spec() this.spec()
.must(() -> !this.isNull(item.getHasMultiplicity())) .must(() -> !this.isNull(item.getHasMultiplicity()))
.failOn(FieldSetPersist._hasMultiplicity).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._hasMultiplicity}, LocaleContextHolder.getLocale())), .failOn(FieldSetPersist._hasMultiplicity).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._hasMultiplicity}, LocaleContextHolder.getLocale())),
this.spec() this.spec()
.must(() -> !this.isEmpty(item.getTitle())) .must(() -> !this.isEmpty(item.getTitle()))
.failOn(FieldSetPersist._title).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._title}, LocaleContextHolder.getLocale())), .failOn(FieldSetPersist._title).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{FieldSetPersist._title}, LocaleContextHolder.getLocale())),
this.refSpec() this.refSpec()
.iff(() -> !this.isNull(item.getMultiplicity())) .iff(() -> !this.isNull(item.getMultiplicity()))
.on(FieldSetPersist._multiplicity) .on(FieldSetPersist._multiplicity)

View File

@ -2,9 +2,9 @@ package org.opencdmp.model.persist.descriptiontemplatedefinition.fielddata;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import gr.cite.tools.validation.specification.Specification;
import org.opencdmp.commons.enums.FieldType; import org.opencdmp.commons.enums.FieldType;
import org.opencdmp.commons.validation.BaseValidator; import org.opencdmp.commons.validation.BaseValidator;
import gr.cite.tools.validation.specification.Specification;
import org.opencdmp.convention.ConventionService; import org.opencdmp.convention.ConventionService;
import org.opencdmp.errorcode.ErrorThesaurusProperties; import org.opencdmp.errorcode.ErrorThesaurusProperties;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
@ -39,7 +39,7 @@ import java.util.List;
}) })
public abstract class BaseFieldDataPersist { public abstract class BaseFieldDataPersist {
private String label = null; private String label;
public static final String _label = "label"; public static final String _label = "label";
@ -48,7 +48,7 @@ public abstract class BaseFieldDataPersist {
public static final String _fieldType = "fieldType"; public static final String _fieldType = "fieldType";
public String getLabel() { public String getLabel() {
return label; return this.label;
} }
public void setLabel(String label) { public void setLabel(String label) {
@ -56,7 +56,7 @@ public abstract class BaseFieldDataPersist {
} }
public FieldType getFieldType() { public FieldType getFieldType() {
return fieldType; return this.fieldType;
} }
public void setFieldType(FieldType fieldType) { public void setFieldType(FieldType fieldType) {
@ -73,13 +73,11 @@ public abstract class BaseFieldDataPersist {
} }
protected List<Specification> getBaseSpecifications(T item) { protected List<Specification> getBaseSpecifications(T item) {
List<Specification> specifications = new ArrayList<>(); return new ArrayList<>(Arrays.asList(
specifications.addAll(Arrays.asList(
this.spec() this.spec()
.must(() -> !this.isNull(item.getFieldType())) .must(() -> !this.isNull(item.getFieldType()))
.failOn(BaseFieldDataPersist._fieldType).failWith(messageSource.getMessage("Validation_Required", new Object[]{BaseFieldDataPersist._fieldType}, LocaleContextHolder.getLocale())) .failOn(BaseFieldDataPersist._fieldType).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{BaseFieldDataPersist._fieldType}, LocaleContextHolder.getLocale()))
)); ));
return specifications;
} }
} }