Skip to content

Commit

Permalink
Set DTOs parameters as private (standard way by rules) (#284)
Browse files Browse the repository at this point in the history
Signed-off-by: Tristan Chuine <[email protected]>
  • Loading branch information
Tristan-WorkGH authored Jul 13, 2023
1 parent c50daeb commit 89622a2
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
@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 @@ -34,9 +34,8 @@
@JsonTypeName("BRANCH_STATUS_MODIFICATION")
@ModificationErrorTypeName("BRANCH_ACTION_ERROR")
public class BranchStatusModificationInfos extends EquipmentModificationInfos {

@Schema(description = "Action type")
ActionType action;
private ActionType action;

@Schema(description = "Energized end one or two voltage level ID")
private String energizedVoltageLevelId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
@JsonTypeName("GENERATION_DISPATCH")
@ModificationErrorTypeName("GENERATION_DISPATCH_ERROR")
public class GenerationDispatchInfos extends ModificationInfos {

@Schema(description = "loss coefficient")
Double lossCoefficient;
private Double lossCoefficient;

@Schema(description = "default outage rate")
Double defaultOutageRate;
private Double defaultOutageRate;

@Schema(description = "generators without outage")
private List<GeneratorsFilterInfos> generatorsWithoutOutage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ public class GeneratorsFrequencyReserveInfos {
private List<GeneratorsFilterInfos> generatorsFilters;

@Schema(description = "frequency reserve")
Double frequencyReserve;
private Double frequencyReserve;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class ModificationInfos {
private UUID uuid;

@Schema(description = "Modification date")
ZonedDateTime date;
private ZonedDateTime date;

@JsonIgnore
public ModificationEntity toEntity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public ApplicationStatus max(ApplicationStatus other) {
}

@Schema(description = "Global application status")
ApplicationStatus applicationStatus;
private ApplicationStatus applicationStatus;

@Schema(description = "Last group application status")
ApplicationStatus lastGroupApplicationStatus;
private ApplicationStatus lastGroupApplicationStatus;

@Schema(description = "Network modification impacts")
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@
@ToString
@Schema(description = "Scaling creation")
public class ScalingVariationInfos {

@Schema(description = "id")
UUID id;
private UUID id;

@Schema(description = "filters")
List<FilterInfos> filters;
private List<FilterInfos> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
@ToString
@EqualsAndHashCode
public class VoltageLevelInfos {

String id;

String name;
private String id;
private String name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
})
@Schema(description = "Line Type")
public class LineTypeInfos {

@EqualsAndHashCode.Exclude
@Schema(description = "id")
UUID id;
private UUID id;

@Schema(description = "Type Name")
private String type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@EqualsAndHashCode
public class BasicEquipmentInfos {
@Id
String uniqueId;
private String uniqueId;

@MultiField(
mainField = @Field(name = "equipmentId", type = FieldType.Text),
Expand All @@ -36,9 +36,9 @@ public class BasicEquipmentInfos {
@InnerField(suffix = "raw", type = FieldType.Keyword)
}
)
String id;
private String id;

UUID networkUuid;
private UUID networkUuid;

String variantId;
private String variantId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public class EquipmentInfos extends BasicEquipmentInfos {
@InnerField(suffix = "raw", type = FieldType.Keyword)
}
)
String name;
private String name;

@Field("equipmentType")
String type;
private String type;

@Field(type = FieldType.Nested, includeInParent = true)
Set<VoltageLevelInfos> voltageLevels;
private Set<VoltageLevelInfos> voltageLevels;

public static Set<VoltageLevelInfos> getVoltageLevels(@NonNull Identifiable<?> identifiable) {
if (identifiable instanceof Substation) {
Expand Down

0 comments on commit 89622a2

Please sign in to comment.