Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Lombok anotations & DTOs #268

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -20,7 +22,6 @@
@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString(callSuper = true)
@Schema(description = "Attribute modification")
public class AttributeModification<T> {
private T value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@
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;

/**
* @author Nicolas Noir <nicolas.noir at rte-france.com>
*/
@SuperBuilder
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@AllArgsConstructor
@Data
@Schema(description = "Basic equipment modification")
public class BasicEquipmentModificationInfos extends EquipmentModificationInfos {
@Schema(description = "Equipment name modification")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@

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;

/**
* @author Sylvain Bouzols <sylvain.bouzols at rte-france.com>
*/
@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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@
* 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;

/**
* @author Ayoub LABIDI <ayoub.labidi at rte-france.com>
*/
@SuperBuilder
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@AllArgsConstructor
@Data
@Schema(description = "Branch creation")
public class BranchModificationInfos extends BasicEquipmentModificationInfos {

@Schema(description = "Series resistance")
private AttributeModification<Double> seriesResistance;

Expand All @@ -34,5 +32,4 @@ public class BranchModificationInfos extends BasicEquipmentModificationInfos {

@Schema(description = "Current limits Side 2")
private CurrentLimitsModificationInfos currentLimits2;

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@
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.dto.annotation.ModificationErrorTypeName;
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;

/**
* @author Slimane Amar <slimane.amar at rte-france.com>
*/
@SuperBuilder
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@AllArgsConstructor
@Data
@Schema(description = "Branch status modification")
@JsonTypeName("BRANCH_STATUS_MODIFICATION")
@ModificationErrorTypeName("BRANCH_ACTION_ERROR")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,8 +22,7 @@
*/
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Data
@Schema(description = "Build infos")
public class BuildInfos {
private String originVariantId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <laurent.garnier at rte-france.com>
*/
@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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <laurent.garnier at rte-france.com>
*/
@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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ayoub.labidi at rte-france.com>
*/
@SuperBuilder
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Data
@Schema(description = "Coupling device creation")
public class CouplingDeviceInfos {
@Schema(description = "bus bar section 1 id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -20,15 +19,12 @@
/**
* @author Sylvain Bouzols <sylvain.bouzols at rte-france.com>
*/

@SuperBuilder
@Builder
@NoArgsConstructor
@Getter
@Setter
@ToString
@AllArgsConstructor
@Data
@Schema(description = "Current Limits")
public class CurrentLimitsInfos {

@Schema(description = "Permanent current limit")
private Double permanentLimit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -21,15 +19,12 @@
/**
* @author Ayoub LABIDI <ayoub.labidi at rte-france.com>
*/

@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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@

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 <david.braquart at rte-france.com>
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
@ToString
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CurrentTemporaryLimitCreationInfos {

@Schema(description = "name")
private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@

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 <ayoub.labidi at rte-france.com>
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CurrentTemporaryLimitModificationInfos {

@Schema(description = "name")
private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,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.dto.annotation.ModificationErrorTypeName;
import org.gridsuite.modification.server.entities.equipment.modification.DeleteAttachingLineEntity;
Expand All @@ -27,14 +25,11 @@
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@Data
@Schema(description = "Delete attaching line infos")
@JsonTypeName("DELETE_ATTACHING_LINE")
@ModificationErrorTypeName("DELETE_ATTACHING_LINE_ERROR")
public class DeleteAttachingLineInfos extends ModificationInfos {

@Schema(description = "line 1 id")
private String lineToAttachTo1Id;

Expand Down
Loading