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

feat(#453): de-constructing #447 RSR-1116 #454

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ public Optional<DoLinkedToDa> findDoLinkedToDa(TDataTypeTemplates dtt, String lN
));
}

public Stream<String> getEnumValues(TDataTypeTemplates dataTypeTemplates, String lnType, DoLinkedToDaFilter doLinkedToDaFilter) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this in RCONF

return findDoLinkedToDa(dataTypeTemplates, lnType, doLinkedToDaFilter)
.map(DoLinkedToDa::dataAttribute)
.filter(dataAttribute -> TPredefinedBasicTypeEnum.ENUM.equals(dataAttribute.getBType()))
.map(DataAttribute::getType)
.flatMap(enumId ->
dataTypeTemplates.getEnumType().stream()
.filter(tEnumType -> tEnumType.getId().equals(enumId))
.findFirst())
.stream()
.flatMap(tEnumType -> tEnumType.getEnumVal().stream())
.map(TEnumVal::getValue);
}

private Optional<TDAType> getDATypeByDaName(TDataTypeTemplates dtt, TDOType tdoType, String daName) {
return sdoOrDAService.findDA(tdoType, tda -> tda.getName().equals(daName))
.flatMap(tda -> daTypeService.findDaType(dtt, tda.getType()));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,33 @@ public DoLinkedToDaFilter(String doName, List<String> sdoNames, String daName, L
this.daName = StringUtils.isBlank(daName) ? null : daName;
this.bdaNames = bdaNames == null ? Collections.emptyList() : List.copyOf(bdaNames);
}
public DoLinkedToDaFilter(){
this(null,null,null,null);
}

public static DoLinkedToDaFilter from(String doNames, String daNames) {
String doName = null;
List<String> sdoNames = null;
String daName = null;
List<String> bdaNames = null;
if (StringUtils.isNotBlank(doNames)){
if (StringUtils.isNotBlank(doNames)) {
doName = doNames.split("\\.")[0];
sdoNames = Arrays.stream(doNames.split("\\.")).skip(1).toList();
}
if (StringUtils.isNotBlank(daNames)){
if (StringUtils.isNotBlank(daNames)) {
daName = daNames.split("\\.")[0];
bdaNames = Arrays.stream(daNames.split("\\.")).skip(1).toList();
}
return new DoLinkedToDaFilter(doName, sdoNames, daName, bdaNames);
}

public String getDoRef() {
return doName + (sdoNames().isEmpty() ? StringUtils.EMPTY : "." + String.join(".", sdoNames()));
}
public String getDoRef() {
return doName + (sdoNames().isEmpty() ? StringUtils.EMPTY : "." + String.join(".", sdoNames()));
}

public String getDaRef() {
return daName + (bdaNames().isEmpty() ? StringUtils.EMPTY : "." + String.join(".", bdaNames()));
}
public String getDaRef() {
return daName + (bdaNames().isEmpty() ? StringUtils.EMPTY : "." + String.join(".", bdaNames()));
}

@Override
public String toString() {
return getDoRef() + "." + getDaRef();
}
}
Loading
Loading