Skip to content

Commit

Permalink
[Generator] Add helper method getTypeCollection to TypeUtil
Browse files Browse the repository at this point in the history
Rename old method getTypeCollection to getTypeCollectionName.
  • Loading branch information
Thomas Reuter authored and Donato Sciarra committed Feb 7, 2019
1 parent 906fb91 commit f1c8c94
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,18 @@ class TypeUtil {
(datatype.eContainer as FTypeCollection).name !== null;
}

def String getTypeCollectionName(FType datatype) {
def FTypeCollection getTypeCollection(FType datatype) {
if(!datatype.isPartOfTypeCollection) {
throw new IllegalStateException(
"Datatype " + datatype.name + " is not part of a type collection."
+ " Please call isPartOfTypeCollection before calling this method."
);
}
return (datatype.eContainer as FTypeCollection).joynrName;
return (datatype.eContainer as FTypeCollection);
}

def String getTypeCollectionName(FType datatype) {
return (datatype.typeCollection).joynrName;
}

/*
Expand Down

0 comments on commit f1c8c94

Please sign in to comment.