Skip to content

Commit

Permalink
Fix DTOs records
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-WorkGH committed Jun 14, 2023
1 parent fef0dbd commit eb95400
Show file tree
Hide file tree
Showing 68 changed files with 379 additions and 463 deletions.
24 changes: 24 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -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
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,11 +22,10 @@
@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString(callSuper = true)
@Schema(description = "Attribute modification")
public class AttributeModification<T> {
T value;
OperationType op;
private T value;
private OperationType op;

public static <V> AttributeModification<V> toAttributeModification(IAttributeModificationEmbeddable<V> modificationEmbeddable) {
return modificationEmbeddable != null ? toAttributeModification(modificationEmbeddable.getValue(), modificationEmbeddable.getOpType()) : null;
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 @@ -9,31 +9,29 @@
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;

/**
* @author Slimane Amar <slimane.amar at rte-france.com>
*/
@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,
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(callSuper = true)
@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,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 David Braquart <david.braquart at rte-france.com>
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
@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
Loading

0 comments on commit eb95400

Please sign in to comment.