Skip to content

Commit

Permalink
Merge branch 'refactor-line-transformer-entities' of https://github.c…
Browse files Browse the repository at this point in the history
…om/gridsuite/filter-server into organize-by-filter

Signed-off-by: BOUHOURS Antoine <[email protected]>
  • Loading branch information
antoinebhs committed Nov 7, 2023
1 parent b8c5d46 commit 7651ddf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ public void buildGenericFilter(AbstractGenericFilterEntity.AbstractGenericFilter

public void buildInjectionFilter(AbstractInjectionFilterEntity.AbstractInjectionFilterEntityBuilder<?, ?> builder, CriteriaFilter dto) {
buildGenericFilter(builder, dto);
if (!(dto.getEquipmentFilterForm() instanceof AbstractInjectionFilter injectionFilter)) {
if (!(dto.getEquipmentFilterForm() instanceof AbstractInjectionFilter)) {
throw new PowsyblException(WRONG_FILTER_TYPE);
}
AbstractInjectionFilter injectionFilter = (AbstractInjectionFilter) dto.getEquipmentFilterForm();
builder.substationName(injectionFilter.getSubstationName())
.countries(AbstractFilterRepositoryProxy.cloneIfNotEmptyOrNull(injectionFilter.getCountries()))
.substationFreeProperties(convert(injectionFilter.getFreeProperties()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public AbstractFilter toDto(IdentifierListFilterEntity filterEntity) {

@Override
public IdentifierListFilterEntity fromDto(AbstractFilter dto) {
if (dto instanceof IdentifierListFilter filter) {
if (dto instanceof IdentifierListFilter) {
var filter = (IdentifierListFilter) dto;
var identifierListFilterEntityBuilder = IdentifierListFilterEntity.builder()
.equipmentType(filter.getEquipmentType())
.filterEquipmentEntityList(filter.getFilterEquipmentsAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public AbstractFilter toDto(ScriptFilterEntity entity) {

@Override
public ScriptFilterEntity fromDto(AbstractFilter dto) {
if (dto instanceof ScriptFilter filter) {
if (dto instanceof ScriptFilter) {
var filter = (ScriptFilter) dto;
var scriptBuilderEntity = ScriptFilterEntity.builder()
.script(filter.getScript());
buildAbstractFilter(scriptBuilderEntity, filter);
Expand Down

0 comments on commit 7651ddf

Please sign in to comment.