From 89622a275171855769c178f0178f189b63c02cd5 Mon Sep 17 00:00:00 2001 From: Tristan <135599584+Tristan-WorkGH@users.noreply.github.com> Date: Thu, 13 Jul 2023 13:23:20 +0200 Subject: [PATCH] Set DTOs parameters as private (standard way by rules) (#284) Signed-off-by: Tristan Chuine --- .../modification/server/dto/AttributeModification.java | 4 ++-- .../server/dto/BranchStatusModificationInfos.java | 3 +-- .../modification/server/dto/GenerationDispatchInfos.java | 5 ++--- .../server/dto/GeneratorsFrequencyReserveInfos.java | 2 +- .../modification/server/dto/ModificationInfos.java | 2 +- .../server/dto/NetworkModificationResult.java | 4 ++-- .../modification/server/dto/ScalingVariationInfos.java | 9 ++++----- .../modification/server/dto/VoltageLevelInfos.java | 6 ++---- .../modification/server/dto/catalog/LineTypeInfos.java | 3 +-- .../server/dto/elasticsearch/BasicEquipmentInfos.java | 8 ++++---- .../server/dto/elasticsearch/EquipmentInfos.java | 6 +++--- 11 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/gridsuite/modification/server/dto/AttributeModification.java b/src/main/java/org/gridsuite/modification/server/dto/AttributeModification.java index f649262b2..fc1c33c69 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/AttributeModification.java +++ b/src/main/java/org/gridsuite/modification/server/dto/AttributeModification.java @@ -23,8 +23,8 @@ @ToString(callSuper = true) @Schema(description = "Attribute modification") public class AttributeModification { - T value; - OperationType op; + private T value; + private OperationType op; public static AttributeModification toAttributeModification(IAttributeModificationEmbeddable modificationEmbeddable) { return modificationEmbeddable != null ? toAttributeModification(modificationEmbeddable.getValue(), modificationEmbeddable.getOpType()) : null; diff --git a/src/main/java/org/gridsuite/modification/server/dto/BranchStatusModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BranchStatusModificationInfos.java index 25040ad59..cd5ceb9a4 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BranchStatusModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BranchStatusModificationInfos.java @@ -34,9 +34,8 @@ @JsonTypeName("BRANCH_STATUS_MODIFICATION") @ModificationErrorTypeName("BRANCH_ACTION_ERROR") public class BranchStatusModificationInfos extends EquipmentModificationInfos { - @Schema(description = "Action type") - ActionType action; + private ActionType action; @Schema(description = "Energized end one or two voltage level ID") private String energizedVoltageLevelId; diff --git a/src/main/java/org/gridsuite/modification/server/dto/GenerationDispatchInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GenerationDispatchInfos.java index f7a9c97be..221f6b682 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GenerationDispatchInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GenerationDispatchInfos.java @@ -33,12 +33,11 @@ @JsonTypeName("GENERATION_DISPATCH") @ModificationErrorTypeName("GENERATION_DISPATCH_ERROR") public class GenerationDispatchInfos extends ModificationInfos { - @Schema(description = "loss coefficient") - Double lossCoefficient; + private Double lossCoefficient; @Schema(description = "default outage rate") - Double defaultOutageRate; + private Double defaultOutageRate; @Schema(description = "generators without outage") private List generatorsWithoutOutage; diff --git a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFrequencyReserveInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFrequencyReserveInfos.java index 5ca9ed17b..9ab735a71 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFrequencyReserveInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFrequencyReserveInfos.java @@ -29,5 +29,5 @@ public class GeneratorsFrequencyReserveInfos { private List generatorsFilters; @Schema(description = "frequency reserve") - Double frequencyReserve; + private Double frequencyReserve; } diff --git a/src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java index 951141a35..2e3143b74 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java @@ -73,7 +73,7 @@ public class ModificationInfos { private UUID uuid; @Schema(description = "Modification date") - ZonedDateTime date; + private ZonedDateTime date; @JsonIgnore public ModificationEntity toEntity() { diff --git a/src/main/java/org/gridsuite/modification/server/dto/NetworkModificationResult.java b/src/main/java/org/gridsuite/modification/server/dto/NetworkModificationResult.java index 14a52a920..cf0a2cb6f 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/NetworkModificationResult.java +++ b/src/main/java/org/gridsuite/modification/server/dto/NetworkModificationResult.java @@ -40,10 +40,10 @@ public ApplicationStatus max(ApplicationStatus other) { } @Schema(description = "Global application status") - ApplicationStatus applicationStatus; + private ApplicationStatus applicationStatus; @Schema(description = "Last group application status") - ApplicationStatus lastGroupApplicationStatus; + private ApplicationStatus lastGroupApplicationStatus; @Schema(description = "Network modification impacts") @Builder.Default diff --git a/src/main/java/org/gridsuite/modification/server/dto/ScalingVariationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ScalingVariationInfos.java index a38247952..481def036 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ScalingVariationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ScalingVariationInfos.java @@ -29,18 +29,17 @@ @ToString @Schema(description = "Scaling creation") public class ScalingVariationInfos { - @Schema(description = "id") - UUID id; + private UUID id; @Schema(description = "filters") - List filters; + private List filters; @Schema(description = "variation mode") - VariationMode variationMode; + private VariationMode variationMode; @Schema(description = "variation value") - Double variationValue; + private Double variationValue; @Schema(description = "reactiveVariationMode") private ReactiveVariationMode reactiveVariationMode; diff --git a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelInfos.java b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelInfos.java index ab6c34228..272eb9627 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelInfos.java @@ -21,8 +21,6 @@ @ToString @EqualsAndHashCode public class VoltageLevelInfos { - - String id; - - String name; + private String id; + private String name; } diff --git a/src/main/java/org/gridsuite/modification/server/dto/catalog/LineTypeInfos.java b/src/main/java/org/gridsuite/modification/server/dto/catalog/LineTypeInfos.java index e222ffc17..6ecdfb8c6 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/catalog/LineTypeInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/catalog/LineTypeInfos.java @@ -35,10 +35,9 @@ }) @Schema(description = "Line Type") public class LineTypeInfos { - @EqualsAndHashCode.Exclude @Schema(description = "id") - UUID id; + private UUID id; @Schema(description = "Type Name") private String type; diff --git a/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/BasicEquipmentInfos.java b/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/BasicEquipmentInfos.java index cc6d3bfc4..e1d46a85f 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/BasicEquipmentInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/BasicEquipmentInfos.java @@ -27,7 +27,7 @@ @EqualsAndHashCode public class BasicEquipmentInfos { @Id - String uniqueId; + private String uniqueId; @MultiField( mainField = @Field(name = "equipmentId", type = FieldType.Text), @@ -36,9 +36,9 @@ public class BasicEquipmentInfos { @InnerField(suffix = "raw", type = FieldType.Keyword) } ) - String id; + private String id; - UUID networkUuid; + private UUID networkUuid; - String variantId; + private String variantId; } diff --git a/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/EquipmentInfos.java b/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/EquipmentInfos.java index 509e36ec9..2fc40cf47 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/EquipmentInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/EquipmentInfos.java @@ -40,13 +40,13 @@ public class EquipmentInfos extends BasicEquipmentInfos { @InnerField(suffix = "raw", type = FieldType.Keyword) } ) - String name; + private String name; @Field("equipmentType") - String type; + private String type; @Field(type = FieldType.Nested, includeInParent = true) - Set voltageLevels; + private Set voltageLevels; public static Set getVoltageLevels(@NonNull Identifiable identifiable) { if (identifiable instanceof Substation) {