diff --git a/lombok.config b/lombok.config new file mode 100644 index 000000000..2969eaa13 --- /dev/null +++ b/lombok.config @@ -0,0 +1,24 @@ +config.stopbubbling = true + +lombok.addJavaxGeneratedAnnotation = true +lombok.addLombokGeneratedAnnotation = true +lombok.addSuppressWarnings = true +lombok.anyconstructor.addconstructorproperties = true +#lombok.extern.findbugs.addSuppressFBWarnings = true +#checkerframework = true + +lombok.addNullAnnotations = javax + +lombok.accessors.chain = true + +lombok.equalsandhashcode.callsuper = CALL +lombok.tostring.callsuper = CALL + +lombok.log.apacheCommons.flagUsage = ERROR +lombok.log.flogger.flagUsage = ERROR +lombok.log.javaUtilLogging.flagUsage = ERROR +lombok.log.jbosslog.flagUsage = ERROR +lombok.log.log4j.flagUsage = ERROR +lombok.log.log4j2.flagUsage = ERROR +#lombok.log.slf4j.flagUsage = NONE +#lombok.log.xslf4j.flagUsage = NONE 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..b047dfb06 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/AttributeModification.java +++ b/src/main/java/org/gridsuite/modification/server/dto/AttributeModification.java @@ -7,7 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.entities.equipment.modification.attribute.IAttributeModificationEmbeddable; @@ -20,11 +22,10 @@ @NoArgsConstructor @AllArgsConstructor @Data -@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/BasicEquipmentModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BasicEquipmentModificationInfos.java index 42027d3aa..df6b33d7e 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BasicEquipmentModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BasicEquipmentModificationInfos.java @@ -7,10 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; /** @@ -18,9 +17,8 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Basic equipment modification") public class BasicEquipmentModificationInfos extends EquipmentModificationInfos { @Schema(description = "Equipment name modification") diff --git a/src/main/java/org/gridsuite/modification/server/dto/BranchCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BranchCreationInfos.java index c9d66f46e..177af0660 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BranchCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BranchCreationInfos.java @@ -8,10 +8,9 @@ import com.powsybl.iidm.network.extensions.ConnectablePosition; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; /** @@ -19,12 +18,10 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Branch creation") public class BranchCreationInfos extends EquipmentCreationInfos { - @Schema(description = "Series resistance") private double seriesResistance; diff --git a/src/main/java/org/gridsuite/modification/server/dto/BranchModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BranchModificationInfos.java index 35a5e1244..8212f26c6 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BranchModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BranchModificationInfos.java @@ -5,11 +5,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.gridsuite.modification.server.dto; + import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; /** @@ -17,12 +17,10 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Branch creation") public class BranchModificationInfos extends BasicEquipmentModificationInfos { - @Schema(description = "Series resistance") private AttributeModification seriesResistance; @@ -34,5 +32,4 @@ public class BranchModificationInfos extends BasicEquipmentModificationInfos { @Schema(description = "Current limits Side 2") private CurrentLimitsModificationInfos currentLimits2; - } 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 3ac4b7bd6..a1f0ebf83 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BranchStatusModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BranchStatusModificationInfos.java @@ -9,16 +9,16 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; import org.gridsuite.modification.server.entities.equipment.modification.BranchStatusModificationEntity; import org.gridsuite.modification.server.modifications.AbstractModification; import org.gridsuite.modification.server.modifications.BranchStatusModification; + import static org.gridsuite.modification.server.NetworkModificationException.Type.BRANCH_ACTION_TYPE_EMPTY; /** @@ -26,14 +26,12 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Branch status modification") public class BranchStatusModificationInfos extends EquipmentModificationInfos { - @Schema(description = "Action type") - ActionType action; + private ActionType action; public enum ActionType { LOCKOUT, diff --git a/src/main/java/org/gridsuite/modification/server/dto/BuildInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BuildInfos.java index 285b3ec6c..38f05cd97 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BuildInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BuildInfos.java @@ -8,9 +8,8 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; import java.util.ArrayList; import java.util.HashSet; @@ -23,8 +22,7 @@ */ @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Build infos") public class BuildInfos { private String originVariantId; diff --git a/src/main/java/org/gridsuite/modification/server/dto/BusbarConnectionCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BusbarConnectionCreationInfos.java index 89721e18c..4ac5b1e44 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BusbarConnectionCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BusbarConnectionCreationInfos.java @@ -9,19 +9,17 @@ import com.powsybl.iidm.network.SwitchKind; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; /** * @author Laurent GARNIER */ -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Voltage level bus bar sections connection creation") public class BusbarConnectionCreationInfos { @Schema(description = "one side of the connection") diff --git a/src/main/java/org/gridsuite/modification/server/dto/BusbarSectionCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/BusbarSectionCreationInfos.java index 7a0ffada6..453e714ac 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/BusbarSectionCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/BusbarSectionCreationInfos.java @@ -8,21 +8,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; /** * @author Laurent GARNIER */ -@ToString(callSuper = true) -@SuperBuilder +@Data +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter @Schema(description = "Voltage level bus bar section creation") public class BusbarSectionCreationInfos { @Schema(description = "bus bar section id") diff --git a/src/main/java/org/gridsuite/modification/server/dto/CouplingDeviceInfos.java b/src/main/java/org/gridsuite/modification/server/dto/CouplingDeviceInfos.java index a609d0346..c8fb74d68 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/CouplingDeviceInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/CouplingDeviceInfos.java @@ -8,19 +8,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; /** * @author Ayoub LABIDI */ -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Coupling device creation") public class CouplingDeviceInfos { @Schema(description = "bus bar section 1 id") diff --git a/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsInfos.java b/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsInfos.java index 7c49e6f69..284ff2eec 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsInfos.java @@ -7,11 +7,10 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.entities.equipment.creation.CurrentLimitsEntity; import org.gridsuite.modification.server.entities.equipment.creation.CurrentTemporaryLimitCreationEmbeddable; @@ -20,15 +19,12 @@ /** * @author Sylvain Bouzols */ - -@SuperBuilder +@Builder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Current Limits") public class CurrentLimitsInfos { - @Schema(description = "Permanent current limit") private Double permanentLimit; diff --git a/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsModificationInfos.java index a94379ee0..a75422220 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/CurrentLimitsModificationInfos.java @@ -7,12 +7,10 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; - import org.gridsuite.modification.server.entities.equipment.modification.CurrentLimitsModificationEntity; import org.gridsuite.modification.server.entities.equipment.modification.CurrentTemporaryLimitModificationEmbeddable; @@ -21,15 +19,12 @@ /** * @author Ayoub LABIDI */ - -@SuperBuilder +@Builder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Current Limits") public class CurrentLimitsModificationInfos { - @Schema(description = "Permanent current limit") private Double permanentLimit; diff --git a/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitCreationInfos.java index 674422b20..02e6a33af 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitCreationInfos.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * @author David Braquart @@ -16,10 +19,9 @@ @Builder @AllArgsConstructor @NoArgsConstructor -@Getter +@Data @JsonInclude(JsonInclude.Include.NON_NULL) public class CurrentTemporaryLimitCreationInfos { - @Schema(description = "name") private String name; diff --git a/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitModificationInfos.java index 0427b288c..a77facc90 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/CurrentTemporaryLimitModificationInfos.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * @author Ayoub LABIDI @@ -16,10 +19,9 @@ @Builder @AllArgsConstructor @NoArgsConstructor -@Getter +@Data @JsonInclude(JsonInclude.Include.NON_NULL) public class CurrentTemporaryLimitModificationInfos { - @Schema(description = "name") private String name; diff --git a/src/main/java/org/gridsuite/modification/server/dto/DeleteAttachingLineInfos.java b/src/main/java/org/gridsuite/modification/server/dto/DeleteAttachingLineInfos.java index ff12a36eb..734560e9d 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/DeleteAttachingLineInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/DeleteAttachingLineInfos.java @@ -10,10 +10,8 @@ import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -27,12 +25,9 @@ @SuperBuilder @AllArgsConstructor @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @Schema(description = "Delete attaching line infos") public class DeleteAttachingLineInfos extends ModificationInfos { - @Schema(description = "line 1 id") private String lineToAttachTo1Id; diff --git a/src/main/java/org/gridsuite/modification/server/dto/DeleteVoltageLevelOnLineInfos.java b/src/main/java/org/gridsuite/modification/server/dto/DeleteVoltageLevelOnLineInfos.java index 16ff0cf72..d8a629652 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/DeleteVoltageLevelOnLineInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/DeleteVoltageLevelOnLineInfos.java @@ -9,7 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -24,12 +26,9 @@ @SuperBuilder @AllArgsConstructor @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @Schema(description = "Delete voltage level on line infos") public class DeleteVoltageLevelOnLineInfos extends ModificationInfos { - @Schema(description = "line 1 id") private String lineToAttachTo1Id; diff --git a/src/main/java/org/gridsuite/modification/server/dto/EquipmentAttributeModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/EquipmentAttributeModificationInfos.java index 3e7ebd487..e4cb55598 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/EquipmentAttributeModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/EquipmentAttributeModificationInfos.java @@ -12,15 +12,18 @@ import com.powsybl.commons.reporter.TypedValue; import com.powsybl.iidm.network.IdentifiableType; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; - import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; -import org.gridsuite.modification.server.entities.equipment.modification.attribute.*; +import org.gridsuite.modification.server.entities.equipment.modification.attribute.BooleanEquipmentAttributeModificationEntity; +import org.gridsuite.modification.server.entities.equipment.modification.attribute.DoubleEquipmentAttributeModificationEntity; +import org.gridsuite.modification.server.entities.equipment.modification.attribute.EquipmentAttributeModificationEntity; +import org.gridsuite.modification.server.entities.equipment.modification.attribute.FloatEquipmentAttributeModificationEntity; +import org.gridsuite.modification.server.entities.equipment.modification.attribute.IntegerEquipmentAttributeModificationEntity; +import org.gridsuite.modification.server.entities.equipment.modification.attribute.StringEquipmentAttributeModificationEntity; import org.gridsuite.modification.server.modifications.AbstractModification; import org.gridsuite.modification.server.modifications.EquipmentAttributeModification; import org.springframework.lang.NonNull; @@ -28,16 +31,16 @@ import java.util.Map; import java.util.Set; -import static org.gridsuite.modification.server.NetworkModificationException.Type.*; +import static org.gridsuite.modification.server.NetworkModificationException.Type.EQUIPMENT_ATTRIBUTE_NAME_ERROR; +import static org.gridsuite.modification.server.NetworkModificationException.Type.EQUIPMENT_ATTRIBUTE_VALUE_ERROR; /** * @author Franck Lecuyer */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Equipment attribute modification") public class EquipmentAttributeModificationInfos extends EquipmentModificationInfos { @Schema(description = "Equipment attribute name") diff --git a/src/main/java/org/gridsuite/modification/server/dto/EquipmentCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/EquipmentCreationInfos.java index 3504eabdb..fe0d0e22a 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/EquipmentCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/EquipmentCreationInfos.java @@ -7,10 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; /** @@ -18,9 +17,8 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Equipment creation") public class EquipmentCreationInfos extends EquipmentModificationInfos { @Schema(description = "Equipment name") diff --git a/src/main/java/org/gridsuite/modification/server/dto/EquipmentDeletionInfos.java b/src/main/java/org/gridsuite/modification/server/dto/EquipmentDeletionInfos.java index 5e6bf1121..22d90b101 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/EquipmentDeletionInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/EquipmentDeletionInfos.java @@ -6,28 +6,26 @@ */ package org.gridsuite.modification.server.dto; -import org.gridsuite.modification.server.ModificationType; -import org.gridsuite.modification.server.NetworkModificationException; -import org.gridsuite.modification.server.entities.equipment.deletion.EquipmentDeletionEntity; -import org.gridsuite.modification.server.modifications.AbstractModification; -import org.gridsuite.modification.server.modifications.EquipmentDeletion; import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; +import org.gridsuite.modification.server.ModificationType; +import org.gridsuite.modification.server.NetworkModificationException; +import org.gridsuite.modification.server.entities.equipment.deletion.EquipmentDeletionEntity; +import org.gridsuite.modification.server.modifications.AbstractModification; +import org.gridsuite.modification.server.modifications.EquipmentDeletion; /** * @author Franck Lecuyer */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Equipment deletion") public class EquipmentDeletionInfos extends EquipmentModificationInfos { @Schema(description = "Equipment type") diff --git a/src/main/java/org/gridsuite/modification/server/dto/EquipmentModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/EquipmentModificationInfos.java index d8e2e84f3..65e20f7e6 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/EquipmentModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/EquipmentModificationInfos.java @@ -6,14 +6,12 @@ */ package org.gridsuite.modification.server.dto; -import org.springframework.lang.NonNull; - import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; +import org.springframework.lang.NonNull; /** * @author Slimane Amar @@ -21,11 +19,9 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Equipment modification") - public class EquipmentModificationInfos extends ModificationInfos { @Schema(description = "Equipment ID") @NonNull diff --git a/src/main/java/org/gridsuite/modification/server/dto/FilterEquipments.java b/src/main/java/org/gridsuite/modification/server/dto/FilterEquipments.java index 6003152ed..ed160864b 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/FilterEquipments.java +++ b/src/main/java/org/gridsuite/modification/server/dto/FilterEquipments.java @@ -9,9 +9,8 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; import java.util.List; import java.util.UUID; @@ -19,8 +18,7 @@ /** * @author bendaamerahm */ -@Getter -@Setter +@Data @NoArgsConstructor @AllArgsConstructor @Builder diff --git a/src/main/java/org/gridsuite/modification/server/dto/FilterInfos.java b/src/main/java/org/gridsuite/modification/server/dto/FilterInfos.java index b10f29d09..e680bfa89 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/FilterInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/FilterInfos.java @@ -8,10 +8,9 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.entities.equipment.modification.VariationFilterEntity; import java.util.UUID; @@ -19,14 +18,12 @@ /** * @author bendaamerahm */ -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Filter Infos") public class FilterInfos { - @Schema(description = "id of filter") private UUID id; 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 cdffbb572..cce46ef9b 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GenerationDispatchInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GenerationDispatchInfos.java @@ -10,9 +10,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -27,16 +27,15 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter +@AllArgsConstructor +@Data @Schema(description = "Generation dispatch creation") 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/GeneratorCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GeneratorCreationInfos.java index e69f6717d..33368789e 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorCreationInfos.java @@ -12,29 +12,25 @@ import com.powsybl.iidm.network.EnergySource; import com.powsybl.iidm.network.extensions.ConnectablePosition; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; - -import java.util.List; - import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; import org.gridsuite.modification.server.entities.equipment.creation.GeneratorCreationEntity; import org.gridsuite.modification.server.modifications.AbstractModification; import org.gridsuite.modification.server.modifications.GeneratorCreation; +import java.util.List; + /** * @author Franck Lecuyer */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Generator creation") public class GeneratorCreationInfos extends InjectionCreationInfos { @Schema(description = "Energy source") diff --git a/src/main/java/org/gridsuite/modification/server/dto/GeneratorModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GeneratorModificationInfos.java index 88b1dc41c..55d909dcb 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorModificationInfos.java @@ -6,32 +6,34 @@ */ package org.gridsuite.modification.server.dto; -import java.util.List; - -import org.gridsuite.modification.server.ModificationType; -import org.gridsuite.modification.server.NetworkModificationException; -import org.gridsuite.modification.server.entities.equipment.modification.GeneratorModificationEntity; -import org.gridsuite.modification.server.modifications.AbstractModification; -import org.gridsuite.modification.server.modifications.GeneratorModification; - import com.fasterxml.jackson.annotation.JsonProperty; import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import com.powsybl.iidm.network.EnergySource; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.ToString; import lombok.experimental.SuperBuilder; +import org.gridsuite.modification.server.ModificationType; +import org.gridsuite.modification.server.NetworkModificationException; +import org.gridsuite.modification.server.entities.equipment.modification.GeneratorModificationEntity; +import org.gridsuite.modification.server.modifications.AbstractModification; +import org.gridsuite.modification.server.modifications.GeneratorModification; + +import java.util.List; /** * @author Jacques Borsenberger */ - @SuperBuilder @NoArgsConstructor +@AllArgsConstructor @Data @ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) @Schema(description = "generator modification") public class GeneratorModificationInfos extends InjectionModificationInfos { @Schema(description = "Energy source") diff --git a/src/main/java/org/gridsuite/modification/server/dto/GeneratorScalingInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GeneratorScalingInfos.java index ab337e6c2..b95ffeb42 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorScalingInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorScalingInfos.java @@ -10,9 +10,8 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -23,14 +22,11 @@ /** * @author Seddik Yengui */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Generator scaling creation") public class GeneratorScalingInfos extends ScalingInfos { - @Override public GeneratorScalingEntity toEntity() { return new GeneratorScalingEntity(this); diff --git a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFilterInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFilterInfos.java index e2f5aa76d..a9f22651e 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFilterInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFilterInfos.java @@ -8,24 +8,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; import java.util.UUID; /** * @author Franck Lecuyer */ -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Generators filter Infos") public class GeneratorsFilterInfos { - @Schema(description = "id of generators filter") private UUID id; 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..235c67dde 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFrequencyReserveInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsFrequencyReserveInfos.java @@ -8,26 +8,24 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; import java.util.List; /** * @author Franck Lecuyer */ -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Generators frequency reserve infos") public class GeneratorsFrequencyReserveInfos { @Schema(description = "generators filters") private List generatorsFilters; @Schema(description = "frequency reserve") - Double frequencyReserve; + private Double frequencyReserve; } diff --git a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsWithoutOutageInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsWithoutOutageInfos.java index 9ed316cf8..bd810a8e7 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GeneratorsWithoutOutageInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GeneratorsWithoutOutageInfos.java @@ -8,24 +8,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; import java.util.UUID; /** * @author Franck Lecuyer */ -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Filter Infos") public class GeneratorsWithoutOutageInfos { - @Schema(description = "id of generators filter") private UUID id; diff --git a/src/main/java/org/gridsuite/modification/server/dto/GroovyScriptInfos.java b/src/main/java/org/gridsuite/modification/server/dto/GroovyScriptInfos.java index 6e09ae977..12ae18afc 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/GroovyScriptInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/GroovyScriptInfos.java @@ -6,28 +6,26 @@ */ package org.gridsuite.modification.server.dto; -import org.gridsuite.modification.server.ModificationType; -import org.gridsuite.modification.server.NetworkModificationException; -import org.gridsuite.modification.server.entities.GroovyScriptEntity; -import org.gridsuite.modification.server.modifications.AbstractModification; -import org.gridsuite.modification.server.modifications.GroovyScript; import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; +import org.gridsuite.modification.server.ModificationType; +import org.gridsuite.modification.server.NetworkModificationException; +import org.gridsuite.modification.server.entities.GroovyScriptEntity; +import org.gridsuite.modification.server.modifications.AbstractModification; +import org.gridsuite.modification.server.modifications.GroovyScript; /** * @author Franck Lecuyer */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Groovy script modification") public class GroovyScriptInfos extends ModificationInfos { @Schema(description = "Groovy script") diff --git a/src/main/java/org/gridsuite/modification/server/dto/IdentifiableAttributes.java b/src/main/java/org/gridsuite/modification/server/dto/IdentifiableAttributes.java index a9fe14311..3d96a6357 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/IdentifiableAttributes.java +++ b/src/main/java/org/gridsuite/modification/server/dto/IdentifiableAttributes.java @@ -10,18 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter +@Data @NoArgsConstructor @AllArgsConstructor @Builder @Schema(description = "Identifiable attributes") public class IdentifiableAttributes { - @Schema(description = "identifiable id") private String id; diff --git a/src/main/java/org/gridsuite/modification/server/dto/InjectionCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/InjectionCreationInfos.java index 731673b54..5e54f372b 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/InjectionCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/InjectionCreationInfos.java @@ -7,10 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; /** @@ -18,9 +17,8 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Injection creation") public class InjectionCreationInfos extends EquipmentCreationInfos { @Schema(description = "Voltage level id") diff --git a/src/main/java/org/gridsuite/modification/server/dto/InjectionModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/InjectionModificationInfos.java index 57fe83649..085e79f19 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/InjectionModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/InjectionModificationInfos.java @@ -7,10 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; /** @@ -18,9 +17,8 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Injection modification") public class InjectionModificationInfos extends BasicEquipmentModificationInfos { @Schema(description = "Voltage level id modification") diff --git a/src/main/java/org/gridsuite/modification/server/dto/LineAttachToVoltageLevelInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LineAttachToVoltageLevelInfos.java index 99011e695..fcbbd6815 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LineAttachToVoltageLevelInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LineAttachToVoltageLevelInfos.java @@ -9,7 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -23,12 +25,9 @@ @SuperBuilder @AllArgsConstructor @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @Schema(description = "Line attach to voltage level") public class LineAttachToVoltageLevelInfos extends ModificationInfos { - @Schema(description = "line to attach to ID") private String lineToAttachToId; diff --git a/src/main/java/org/gridsuite/modification/server/dto/LineCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LineCreationInfos.java index aeaebbc9d..a16e0e092 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LineCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LineCreationInfos.java @@ -9,10 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -23,15 +22,12 @@ /** * @author Sylvain Bouzols */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Line creation") public class LineCreationInfos extends BranchCreationInfos { - @Schema(description = "Shunt conductance Side 1") private Double shuntConductance1; diff --git a/src/main/java/org/gridsuite/modification/server/dto/LineModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LineModificationInfos.java index 8ec3e0cc7..e0bcb408e 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LineModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LineModificationInfos.java @@ -9,10 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -23,15 +22,12 @@ /** * @author Ayoub LABIDI */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Line modification") public class LineModificationInfos extends BranchModificationInfos { - @Schema(description = "Shunt conductance Side 1") private AttributeModification shuntConductance1; diff --git a/src/main/java/org/gridsuite/modification/server/dto/LineSplitWithVoltageLevelInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LineSplitWithVoltageLevelInfos.java index c0e4893b0..702f19065 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LineSplitWithVoltageLevelInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LineSplitWithVoltageLevelInfos.java @@ -9,9 +9,10 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; - import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; import org.gridsuite.modification.server.entities.equipment.modification.LineSplitWithVoltageLevelEntity; @@ -24,12 +25,9 @@ @SuperBuilder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @Schema(description = "Line split with voltage level") public class LineSplitWithVoltageLevelInfos extends ModificationInfos { - @Schema(description = "line to split ID") private String lineToSplitId; diff --git a/src/main/java/org/gridsuite/modification/server/dto/LinesAttachToSplitLinesInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LinesAttachToSplitLinesInfos.java index 0aaa16dd4..87707becd 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LinesAttachToSplitLinesInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LinesAttachToSplitLinesInfos.java @@ -9,7 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -24,12 +26,9 @@ @SuperBuilder @AllArgsConstructor @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @Schema(description = "Line attach to split line") public class LinesAttachToSplitLinesInfos extends ModificationInfos { - @Schema(description = "line 1 id") private String lineToAttachTo1Id; diff --git a/src/main/java/org/gridsuite/modification/server/dto/LoadCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LoadCreationInfos.java index 9c781551d..190a06690 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LoadCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LoadCreationInfos.java @@ -11,10 +11,9 @@ import com.powsybl.iidm.network.LoadType; import com.powsybl.iidm.network.extensions.ConnectablePosition; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -25,12 +24,10 @@ /** * @author Franck Lecuyer */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Load creation") public class LoadCreationInfos extends InjectionCreationInfos { @Schema(description = "Load type") diff --git a/src/main/java/org/gridsuite/modification/server/dto/LoadModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LoadModificationInfos.java index a4fc9153a..9925c171f 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LoadModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LoadModificationInfos.java @@ -6,27 +6,25 @@ */ package org.gridsuite.modification.server.dto; -import org.gridsuite.modification.server.ModificationType; -import org.gridsuite.modification.server.NetworkModificationException; -import org.gridsuite.modification.server.entities.equipment.modification.LoadModificationEntity; -import org.gridsuite.modification.server.modifications.AbstractModification; -import org.gridsuite.modification.server.modifications.LoadModification; import com.fasterxml.jackson.annotation.JsonInclude; import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import com.powsybl.iidm.network.LoadType; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; +import org.gridsuite.modification.server.ModificationType; +import org.gridsuite.modification.server.NetworkModificationException; +import org.gridsuite.modification.server.entities.equipment.modification.LoadModificationEntity; +import org.gridsuite.modification.server.modifications.AbstractModification; +import org.gridsuite.modification.server.modifications.LoadModification; @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @JsonInclude(JsonInclude.Include.NON_NULL) @Schema(description = "Load modification") public class LoadModificationInfos extends InjectionModificationInfos { diff --git a/src/main/java/org/gridsuite/modification/server/dto/LoadScalingInfos.java b/src/main/java/org/gridsuite/modification/server/dto/LoadScalingInfos.java index 927f4e610..c813c1741 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/LoadScalingInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/LoadScalingInfos.java @@ -9,10 +9,8 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -25,12 +23,9 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @Schema(description = "Load scaling creation") public class LoadScalingInfos extends ScalingInfos { - @Override public LoadScalingEntity toEntity() { return new LoadScalingEntity(this); 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 1988bfe46..e9f81d0ff 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java @@ -12,10 +12,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.NetworkModificationException; import org.gridsuite.modification.server.entities.ModificationEntity; @@ -60,16 +59,15 @@ }) @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString +@AllArgsConstructor +@Data @Schema(description = "Modification attributes") public class ModificationInfos { @Schema(description = "Modification id") 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/NetworkInfos.java b/src/main/java/org/gridsuite/modification/server/dto/NetworkInfos.java index 4c2790074..e263fed69 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/NetworkInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/NetworkInfos.java @@ -9,7 +9,8 @@ import com.powsybl.iidm.network.Network; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Data; +import lombok.NoArgsConstructor; import java.util.UUID; @@ -17,7 +18,8 @@ * @author Franck Lecuyer */ @AllArgsConstructor -@Getter +@NoArgsConstructor +@Data @Schema(description = "Network infos") public class NetworkInfos { private Network network; 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 e213142e3..3a8abbca7 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/NetworkModificationResult.java +++ b/src/main/java/org/gridsuite/modification/server/dto/NetworkModificationResult.java @@ -7,8 +7,10 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import org.gridsuite.modification.server.impacts.SimpleElementImpact; import java.util.List; @@ -20,6 +22,8 @@ * @author Slimane Amar */ @Builder +@NoArgsConstructor +@AllArgsConstructor @Data @Schema(description = "Network modification result") public class NetworkModificationResult { @@ -40,7 +44,7 @@ public ApplicationStatus max(ApplicationStatus other) { } @Schema(description = "Application status") - ApplicationStatus applicationStatus; + private ApplicationStatus applicationStatus; @Schema(description = "Network modification impacts") @Builder.Default diff --git a/src/main/java/org/gridsuite/modification/server/dto/PhaseTapChangerCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/PhaseTapChangerCreationInfos.java index 9d53b0ecd..5459a44fb 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/PhaseTapChangerCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/PhaseTapChangerCreationInfos.java @@ -8,7 +8,9 @@ import com.powsybl.iidm.network.PhaseTapChanger; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; /** @@ -16,12 +18,10 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "PhaseTapChanger attributes") public class PhaseTapChangerCreationInfos extends TapChangerCreationInfos { - @Schema(description = "regulationMode") private PhaseTapChanger.RegulationMode regulationMode; diff --git a/src/main/java/org/gridsuite/modification/server/dto/RatioTapChangerCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/RatioTapChangerCreationInfos.java index 381103745..7cefe7fde 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/RatioTapChangerCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/RatioTapChangerCreationInfos.java @@ -7,7 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; /** @@ -15,12 +17,10 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "RatioTapChanger attributes") public class RatioTapChangerCreationInfos extends TapChangerCreationInfos { - @Schema(description = "loadTapChangingCapabilities") private boolean loadTapChangingCapabilities; diff --git a/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveCreationInfos.java index e51e788e4..9b017d97c 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveCreationInfos.java @@ -9,20 +9,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; /** * @author Seddik Yengui */ - -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Generator reactive capability curve point creation") public class ReactiveCapabilityCurveCreationInfos { @Schema(description = "Minimum reactive power ") diff --git a/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveModificationInfos.java index 054d3aafc..7a785f8f1 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ReactiveCapabilityCurveModificationInfos.java @@ -9,20 +9,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; /** * @author Ayoub LABIDI */ - -@SuperBuilder +@Builder @NoArgsConstructor @AllArgsConstructor -@Getter -@Setter +@Data @Schema(description = "Generator reactive capability curve point creation") public class ReactiveCapabilityCurveModificationInfos { @Schema(description = "Minimum reactive power ") diff --git a/src/main/java/org/gridsuite/modification/server/dto/ReportInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ReportInfos.java index 07ff800ed..9a7e25f5d 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ReportInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ReportInfos.java @@ -8,15 +8,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; -import lombok.Getter; +import lombok.Data; +import lombok.NoArgsConstructor; import java.util.UUID; /** * @author Slimane Amar */ +@NoArgsConstructor @AllArgsConstructor -@Getter +@Data @Schema(description = "Report infos") public class ReportInfos { private UUID reportUuid; diff --git a/src/main/java/org/gridsuite/modification/server/dto/ScalingInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ScalingInfos.java index c29f6b03d..b21b8abf8 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ScalingInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ScalingInfos.java @@ -7,10 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.VariationType; @@ -21,10 +20,9 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter +@AllArgsConstructor +@Data @Schema(description = "Scaling infos") -@ToString(callSuper = true) public class ScalingInfos extends ModificationInfos { @Schema(description = "scaling variations") private List variations; 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 ebae91781..5358c526e 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ScalingVariationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ScalingVariationInfos.java @@ -7,11 +7,10 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ReactiveVariationMode; import org.gridsuite.modification.server.VariationMode; import org.gridsuite.modification.server.entities.equipment.modification.ScalingVariationEntity; @@ -22,25 +21,23 @@ /** * @author bendaamerahm */ -@SuperBuilder +@Builder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @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/ShuntCompensatorCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/ShuntCompensatorCreationInfos.java index 7bbc15c51..4f7d4c620 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/ShuntCompensatorCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/ShuntCompensatorCreationInfos.java @@ -11,10 +11,9 @@ import com.powsybl.commons.reporter.ReporterModel; import com.powsybl.iidm.network.extensions.ConnectablePosition; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -25,12 +24,10 @@ /** * @author Jacques Borsenberger */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Shunt compensator creation") public class ShuntCompensatorCreationInfos extends InjectionCreationInfos { @Schema(description = "Maximum number of sections") diff --git a/src/main/java/org/gridsuite/modification/server/dto/SubstationCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/SubstationCreationInfos.java index 71a96be83..73b478166 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/SubstationCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/SubstationCreationInfos.java @@ -11,10 +11,9 @@ import com.powsybl.commons.reporter.ReporterModel; import com.powsybl.iidm.network.Country; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -27,15 +26,12 @@ /** * @author Abdelsalem Hedhili */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Substation creation") public class SubstationCreationInfos extends EquipmentCreationInfos { - @Schema(description = "Substation country") private Country substationCountry; diff --git a/src/main/java/org/gridsuite/modification/server/dto/SubstationFreePropertyInfos.java b/src/main/java/org/gridsuite/modification/server/dto/SubstationFreePropertyInfos.java index 8094710dc..01e92e892 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/SubstationFreePropertyInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/SubstationFreePropertyInfos.java @@ -8,17 +8,18 @@ import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import lombok.experimental.SuperBuilder; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * @author David Braquart */ -@SuperBuilder +@Builder @NoArgsConstructor -@Getter -@Setter -@EqualsAndHashCode +@AllArgsConstructor +@Data @JsonInclude(JsonInclude.Include.NON_NULL) @Schema(description = "Substation free properties") public class SubstationFreePropertyInfos { @@ -28,9 +29,11 @@ public class SubstationFreePropertyInfos { @Schema(description = "property value") private String value; + @Builder.Default @Schema(description = "marked as deleted") private boolean deletionMark = false; + @Builder.Default @Schema(description = "property added in current modification") private boolean added = false; } diff --git a/src/main/java/org/gridsuite/modification/server/dto/SubstationModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/SubstationModificationInfos.java index b3f688ba7..4ca25c3b8 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/SubstationModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/SubstationModificationInfos.java @@ -11,10 +11,9 @@ import com.powsybl.commons.reporter.ReporterModel; import com.powsybl.iidm.network.Country; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -29,9 +28,8 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @JsonInclude(JsonInclude.Include.NON_NULL) @Schema(description = "Substation modification") public class SubstationModificationInfos extends BasicEquipmentModificationInfos { diff --git a/src/main/java/org/gridsuite/modification/server/dto/TapChangerCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/TapChangerCreationInfos.java index 80c842313..ee26cd1e9 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/TapChangerCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/TapChangerCreationInfos.java @@ -7,10 +7,9 @@ package org.gridsuite.modification.server.dto; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import java.util.List; @@ -20,12 +19,10 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "TapChanger attributes") public class TapChangerCreationInfos { - @Schema(description = "lowTapPosition") private int lowTapPosition; diff --git a/src/main/java/org/gridsuite/modification/server/dto/TapChangerStepCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/TapChangerStepCreationInfos.java index 26de4df34..e9abbd245 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/TapChangerStepCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/TapChangerStepCreationInfos.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * @author Hugo Marcellin @@ -16,12 +19,9 @@ @Builder @AllArgsConstructor @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@Data @JsonInclude(JsonInclude.Include.NON_NULL) public class TapChangerStepCreationInfos { - @Schema(description = "index") private int index; diff --git a/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerCreationInfos.java index d473e3dbb..2d0d937e3 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerCreationInfos.java @@ -9,10 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -23,15 +22,12 @@ /** * @author Abdelsalem Hedhili */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Two windings transformer creation") public class TwoWindingsTransformerCreationInfos extends BranchCreationInfos { - @Schema(description = "Magnetizing conductance") private double magnetizingConductance; diff --git a/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerModificationInfos.java index d8bd2737e..83c8f4bcf 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/TwoWindingsTransformerModificationInfos.java @@ -9,10 +9,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -25,12 +24,10 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Two windings transformer modification") public class TwoWindingsTransformerModificationInfos extends BranchModificationInfos { - @Schema(description = "Magnetizing conductance") private AttributeModification magnetizingConductance; @@ -65,5 +62,4 @@ public NetworkModificationException.Type getErrorType() { public Reporter createSubReporter(ReporterModel reporter) { return reporter.createSubReporter(ModificationType.TWO_WINDINGS_TRANSFORMER_MODIFICATION.name(), "Two windings transformer modification ${twoWindingsTransformerId}", "twoWindingsTransformerId", getEquipmentId()); } - } diff --git a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelCreationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelCreationInfos.java index 96e175593..17d1f3bfc 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelCreationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelCreationInfos.java @@ -6,17 +6,13 @@ */ package org.gridsuite.modification.server.dto; -import java.util.List; - import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import com.powsybl.iidm.network.SwitchKind; - import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -24,17 +20,17 @@ import org.gridsuite.modification.server.modifications.AbstractModification; import org.gridsuite.modification.server.modifications.VoltageLevelCreation; +import java.util.List; + /** * @author Laurent GARNIER */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) +@AllArgsConstructor +@Data @Schema(description = "Voltage level creation") public class VoltageLevelCreationInfos extends EquipmentCreationInfos { - @Schema(description = "substation id") private String substationId; 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..c496c4ac5 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelInfos.java @@ -6,23 +6,19 @@ */ package org.gridsuite.modification.server.dto; -import lombok.EqualsAndHashCode; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.ToString; -import lombok.experimental.SuperBuilder; /** * @author Nicolas Noir */ -@SuperBuilder +@Builder @NoArgsConstructor -@Getter -@ToString -@EqualsAndHashCode +@AllArgsConstructor +@Data public class VoltageLevelInfos { - - String id; - - String name; + private String id; + private String name; } diff --git a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelModificationInfos.java b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelModificationInfos.java index 1c547f4f5..89a13efef 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/VoltageLevelModificationInfos.java @@ -10,9 +10,9 @@ import com.powsybl.commons.reporter.Reporter; import com.powsybl.commons.reporter.ReporterModel; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.ModificationType; import org.gridsuite.modification.server.NetworkModificationException; @@ -23,11 +23,10 @@ /** * @author Seddik Yengui */ - @SuperBuilder @NoArgsConstructor -@Getter -@Setter +@AllArgsConstructor +@Data @Schema(description = "Voltage level modification") public class VoltageLevelModificationInfos extends BasicEquipmentModificationInfos { @Schema(description = "nominal voltage in kV") diff --git a/src/main/java/org/gridsuite/modification/server/dto/catalog/AerialLineTypeInfos.java b/src/main/java/org/gridsuite/modification/server/dto/catalog/AerialLineTypeInfos.java index e13b2db47..88db7b5d6 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/catalog/AerialLineTypeInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/catalog/AerialLineTypeInfos.java @@ -7,23 +7,21 @@ package org.gridsuite.modification.server.dto.catalog; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; - import org.gridsuite.modification.server.entities.catalog.AerialLineTypeEntity; /** * @author Sylvain Bouzols */ -@Getter -@Setter +@Data @NoArgsConstructor @AllArgsConstructor @SuperBuilder -@EqualsAndHashCode(callSuper = true) @Schema(description = "Aerial Line Type") public class AerialLineTypeInfos extends LineTypeInfos { - @Schema(description = "Number of conductors") private Integer conductorsNumber; 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..61a0a9c59 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 @@ -6,25 +6,26 @@ */ package org.gridsuite.modification.server.dto.catalog; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import lombok.experimental.SuperBuilder; -import java.util.UUID; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; - +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.entities.catalog.LineTypeEntity; +import java.util.UUID; + /** * @author Sylvain Bouzols */ -@Getter -@Setter +@Data @NoArgsConstructor @AllArgsConstructor @SuperBuilder -@EqualsAndHashCode @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "category" @@ -35,10 +36,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/catalog/UndergroundLineTypeInfos.java b/src/main/java/org/gridsuite/modification/server/dto/catalog/UndergroundLineTypeInfos.java index 438b33d0e..26711267a 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/catalog/UndergroundLineTypeInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/catalog/UndergroundLineTypeInfos.java @@ -7,23 +7,21 @@ package org.gridsuite.modification.server.dto.catalog; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; - import org.gridsuite.modification.server.entities.catalog.UndergroundLineTypeEntity; /** * @author Sylvain Bouzols */ -@Getter -@Setter +@Data @NoArgsConstructor @AllArgsConstructor @SuperBuilder -@EqualsAndHashCode(callSuper = true) @Schema(description = "Underground Line Type") public class UndergroundLineTypeInfos extends LineTypeInfos { - @Schema(description = "Insulator") private String insulator; 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..89ef3ac10 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 @@ -6,7 +6,10 @@ */ package org.gridsuite.modification.server.dto.elasticsearch; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Field; @@ -21,13 +24,12 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString +@AllArgsConstructor +@Data @EqualsAndHashCode -public class BasicEquipmentInfos { +class BasicEquipmentInfos { @Id - String uniqueId; + private String uniqueId; @MultiField( mainField = @Field(name = "equipmentId", type = FieldType.Text), @@ -36,9 +38,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..fe3d25d41 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 @@ -6,13 +6,28 @@ */ package org.gridsuite.modification.server.dto.elasticsearch; -import com.powsybl.iidm.network.*; -import lombok.*; +import com.powsybl.iidm.network.Branch; +import com.powsybl.iidm.network.Bus; +import com.powsybl.iidm.network.HvdcLine; +import com.powsybl.iidm.network.Identifiable; +import com.powsybl.iidm.network.Injection; +import com.powsybl.iidm.network.Substation; +import com.powsybl.iidm.network.Switch; +import com.powsybl.iidm.network.ThreeWindingsTransformer; +import com.powsybl.iidm.network.VoltageLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.gridsuite.modification.server.NetworkModificationException; import org.gridsuite.modification.server.dto.VoltageLevelInfos; import org.springframework.data.annotation.TypeAlias; -import org.springframework.data.elasticsearch.annotations.*; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.InnerField; +import org.springframework.data.elasticsearch.annotations.MultiField; +import org.springframework.data.elasticsearch.annotations.Setting; import org.springframework.lang.NonNull; import java.util.Set; @@ -25,10 +40,8 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) +@AllArgsConstructor +@Data @Document(indexName = "#{@environment.getProperty('powsybl-ws.elasticsearch.index.prefix')}equipments") @Setting(settingPath = "elasticsearch_settings.json") @TypeAlias(value = "EquipmentInfos") @@ -40,13 +53,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) { diff --git a/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/TombstonedEquipmentInfos.java b/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/TombstonedEquipmentInfos.java index 7d5f149f9..d8e5ac3bb 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/TombstonedEquipmentInfos.java +++ b/src/main/java/org/gridsuite/modification/server/dto/elasticsearch/TombstonedEquipmentInfos.java @@ -6,7 +6,8 @@ */ package org.gridsuite.modification.server.dto.elasticsearch; -import lombok.*; +import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.springframework.data.annotation.TypeAlias; import org.springframework.data.elasticsearch.annotations.Document; @@ -17,10 +18,7 @@ */ @SuperBuilder @NoArgsConstructor -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) +@Data @Document(indexName = "#{@environment.getProperty('powsybl-ws.elasticsearch.index.prefix')}tombstoned-equipments") @Setting(settingPath = "elasticsearch_settings.json") @TypeAlias(value = "TombstonedEquipmentInfos")