]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.common/src/org/simantics/db/common/primitiverequest/IsExternalEntity.java
Added preference for Import dependencies in generic model import/export
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / primitiverequest / IsExternalEntity.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Association for Decentralized Information Management in
3  * Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.common.primitiverequest;
13
14 import org.simantics.db.ReadGraph;
15 import org.simantics.db.Resource;
16 import org.simantics.db.common.request.ResourceRead;
17 import org.simantics.db.exception.ServiceException;
18 import org.simantics.layer0.Layer0;
19
20 /**
21  * @author Tuukka Lehtonen
22  * @since 1.31.0
23  */
24 public final class IsExternalEntity extends ResourceRead<Boolean> {
25
26     public IsExternalEntity(Resource resource) {
27         super(resource);
28     }
29
30     @Override
31     public Boolean perform(ReadGraph graph) throws ServiceException {
32         return graph.isInstanceOf(resource, Layer0.getInstance(graph).ExternalEntity);
33     }
34
35 }