it.xsemantics.runtime.caching.util.XsemanticsCacheUtils Maven / Gradle / Ivy
package it.xsemantics.runtime.caching.util;
import com.google.common.collect.Iterables;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.Functions.Function2;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.Pair;
/**
* Utility functions for caching.
*
* @author Lorenzo Bettini
*
* @since 1.8
*/
@SuppressWarnings("all")
public class XsemanticsCacheUtils {
public Resource getResource(final Object... elements) {
Iterable _filter = Iterables.filter(((Iterable>)Conversions.doWrapArray(elements)), EObject.class);
EObject _head = IterableExtensions.head(_filter);
Resource _eResource = null;
if (_head!=null) {
_eResource=_head.eResource();
}
return _eResource;
}
public Object getKeys(final Object... elements) {
final Function2
© 2015 - 2025 Weber Informatics LLC | Privacy Policy