Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java')
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java
new file mode 100644
index 00000000000..550b495210c
--- /dev/null
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.utils.funtions;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.papyrus.team.collaborative.ExtendedURI;
+import org.eclipse.papyrus.team.collaborative.utils.URIUtils;
+
+import com.google.common.base.Function;
+
+
+/**
+ * The Class IResourceToExtendedURI.
+ * Function used to convert {@link IResource} to {@link ExtendedURI}
+ */
+public class IResourceToExtendedURI implements Function<IResource, ExtendedURI> {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.common.base.Function#apply(java.lang.Object)
+ */
+ @Override
+ public ExtendedURI apply(IResource from) {
+ return new ExtendedURI(URIUtils.getURI(from));
+ }
+
+ /**
+ * The Class SingletonHolder.
+ */
+ private static class SingletonHolder {
+
+ /** The instance. */
+ private static IResourceToExtendedURI INSTANCE = new IResourceToExtendedURI();
+ }
+
+ /**
+ * Private constructor.
+ */
+ private IResourceToExtendedURI() {
+ }
+
+ /**
+ * Returns the Singleton instance.
+ * <p>
+ *
+ * @return The Singleton instance.
+ */
+ public static IResourceToExtendedURI getInstance() {
+ return SingletonHolder.INSTANCE;
+ }
+
+}

Back to the top