Skip to content

Update LimitViolationBuilder to reflect changes in LimitViolation #3813

@NathanDissoubray

Description

@NathanDissoubray

Describe the current behavior

LimitViolation uses several new functions that call each other to create a LimitViolation object, with the top most having 11 arguments.

Describe the expected behavior

Use a builder instead with default values.

Describe the motivation

Being able to change the value of any argument without having to put default values for all the other arguments.
For example, here is one of the constructor:

public LimitViolation(String subjectId, LimitViolationType limitType, String limitName, int acceptableDuration,
                          double limit, double limitReduction, double value)

Now if I want to specify a ViolationLocation, I need to call:

public LimitViolation(String subjectId, @Nullable String subjectName, LimitViolationType limitType, @Nullable String limitName, int acceptableDuration,
                          double limit, double limitReduction, double value, @Nullable ThreeSides side, @Nullable ViolationLocation voltageLocation)

Which means I can't just specify the ViolationLocation, I also need to specify subjectName, and side even though I might not have any interest in those values.

Extra Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions