Skip to content

Commit

Permalink
solve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tunacicek committed Aug 15, 2023
1 parent 6247994 commit e9698bd
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package org.eclipse.tractusx.semantics.registry;

import org.eclipse.tractusx.semantics.aas.registry.model.*;

import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -207,18 +209,22 @@ public static SpecificAssetId createSpecificAssetId(){
return specificAssetId1;
}

public static SpecificAssetId createSpecificAssetId(String name, String value, String externalSubjectId){
public static SpecificAssetId createSpecificAssetId(String name, String value, List<String> externalSubjectIds){
SpecificAssetId specificAssetId1 = new SpecificAssetId();
specificAssetId1.setName(name);
specificAssetId1.setValue(value);

if(externalSubjectId!=null){
if(externalSubjectIds!=null && !externalSubjectIds.isEmpty()) {
Reference reference = new Reference();
reference.setType(ReferenceTypes.EXTERNALREFERENCE);
Key key = new Key();
key.setType(KeyTypes.SUBMODEL);
key.setValue(externalSubjectId);
reference.setKeys(List.of(key));
List<Key> keys = new ArrayList<>();
externalSubjectIds.forEach( externalSubjectId-> {
Key key = new Key();
key.setType(KeyTypes.SUBMODEL);
key.setValue(externalSubjectId);
keys.add( key );
});
reference.setKeys(keys);
specificAssetId1.setExternalSubjectId(reference);
}

Expand Down

0 comments on commit e9698bd

Please sign in to comment.