X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.common%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fcommon%2Fprimitiverequest%2FIsExternalEntity.java;fp=bundles%2Forg.simantics.db.common%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fcommon%2Fprimitiverequest%2FIsExternalEntity.java;h=3ac3a5f3d3b04cb33dc61fe7a961803e74d992f1;hb=28383a4302178eb8aaac0c0e870fec438dbca935;hp=0000000000000000000000000000000000000000;hpb=0807209928f01e95669af6aeb671110209774bc6;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/primitiverequest/IsExternalEntity.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/primitiverequest/IsExternalEntity.java new file mode 100644 index 000000000..3ac3a5f3d --- /dev/null +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/primitiverequest/IsExternalEntity.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2017 Association for Decentralized Information Management in + * Industry THTH ry. + * 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: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package org.simantics.db.common.primitiverequest; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.ResourceRead; +import org.simantics.db.exception.ServiceException; +import org.simantics.layer0.Layer0; + +/** + * @author Tuukka Lehtonen + * @since 1.31.0 + */ +public final class IsExternalEntity extends ResourceRead { + + public IsExternalEntity(Resource resource) { + super(resource); + } + + @Override + public Boolean perform(ReadGraph graph) throws ServiceException { + return graph.isInstanceOf(resource, Layer0.getInstance(graph).ExternalEntity); + } + +}