Skip to content

Commit

Permalink
#ODOC-118
Browse files Browse the repository at this point in the history
  • Loading branch information
donmendelson committed Jul 8, 2021
1 parent 4a2a83f commit 2c0b44b
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ ComponentType copyComponent(final ComponentType source) {
repository.getComponents().getComponent().add(component);
return component;
}

Datatype copyDatatype(final Datatype source) {
final Datatype datatype = (Datatype) source.clone();
repository.getDatatypes().getDatatype().add(datatype);
Expand All @@ -314,14 +314,20 @@ FieldType copyField(final FieldType source) {
return field;
}


GroupType copyGroup(final GroupType source) {
final GroupType group = (GroupType) source.clone();
repository.getGroups().getGroup().add(group);
return group;
}


MessageType copyMessage(final MessageType source) {
final MessageType message = (MessageType) source.clone();
repository.getMessages().getMessage().add(message);
return message;
}


void createRepository() {
repository = new Repository();
repository.setMetadata(new ElementOrRefinementContainer());
Expand Down Expand Up @@ -349,15 +355,6 @@ ActorType findActorByName(final String name) {
return null;
}

CodeType findCodeByValue(final String codesetName, final String scenario, final String value) {
CodeSetType codeset = findCodesetByName(codesetName, scenario);
if (codeset == null) {
return null;
} else {
return findCodeByValue(codeset, value);
}
}

CodeType findCodeByValue(CodeSetType codeset, final String value) {
List<CodeType> codes = codeset.getCode();
for (CodeType code : codes) {
Expand All @@ -368,6 +365,15 @@ CodeType findCodeByValue(CodeSetType codeset, final String value) {
return null;
}

CodeType findCodeByValue(final String codesetName, final String scenario, final String value) {
CodeSetType codeset = findCodesetByName(codesetName, scenario);
if (codeset == null) {
return null;
} else {
return findCodeByValue(codeset, value);
}
}

CodeSetType findCodesetByName(final String name, final String scenario) {
final List<CodeSetType> codesets = repository.getCodeSets().getCodeSet();
for (final CodeSetType codeset : codesets) {
Expand Down
Loading

0 comments on commit 2c0b44b

Please sign in to comment.