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

Add convenient creation methods for IntervalTemporaryDurationCriterion #2954

Merged

Conversation

olperr1
Copy link
Member

@olperr1 olperr1 commented Mar 27, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Feature

What is the current behavior?

The only way to create an IntervalTemporaryDurationCriterion is to use the builder (via builder() method).

What is the new behavior (if this is a feature change)?
3 convenient static methods lowerThan(...), greaterThan(...) and between(...), creating an IntervalTemporaryDurationCriterion with one or both bounds, were added.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

It is thus possible (but not mandatory) to replace:

var criterion = IntervalTemporaryDurationCriterion.builder()
                                  .setLowBound(300, true)
                                  .setHighBound(600, false)
                                  .build();

with:

var criterion = IntervalTemporaryDurationCriterion.between(300, 600, true, false);

…valTemporaryDurationCriterion

Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
…' and 'between' methods

Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Copy link

sonarcloud bot commented Mar 27, 2024

@olperr1 olperr1 merged commit b17a624 into main Mar 27, 2024
6 checks passed
@olperr1 olperr1 deleted the convenient_methods_for_IntervalTemporaryDurationCriterion branch March 27, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants