com.regnosys.rosetta.translate.GeneratorUtil Maven / Gradle / Ivy
package com.regnosys.rosetta.translate;
import com.google.common.collect.Iterables;
import com.regnosys.rosetta.rosetta.RosettaExternalSynonymSource;
import com.regnosys.rosetta.rosetta.RosettaSynonymSource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
@SuppressWarnings("all")
public class GeneratorUtil {
public static List synonymSourceNames(final Collection sources) {
final Function1 _function = (RosettaSynonymSource it) -> {
return it.getName();
};
return ListExtensions.map(GeneratorUtil.synonymSources(sources), _function);
}
public static List externalSynonymSources(final Collection sources) {
return IterableExtensions.toList(Iterables.filter(GeneratorUtil.synonymSources(sources), RosettaExternalSynonymSource.class));
}
private static List synonymSources(final Collection sources) {
final ArrayList collected = CollectionLiterals.newArrayList();
final Consumer _function = (RosettaSynonymSource it) -> {
GeneratorUtil.