Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-07-04 14:07:10 -0400
committerRyan Brooks2018-07-10 19:26:48 -0400
commit0cee3954848c3a92e871f7f8d8aeec9b60dcba49 (patch)
tree9a4fde6e3c4fc04e2ca199ba38d3ae00984b950b
parentf1bfdf16c70e54ed360395dea3e85001bb8ff762 (diff)
downloadorg.eclipse.osee-0cee3954848c3a92e871f7f8d8aeec9b60dcba49.tar.gz
org.eclipse.osee-0cee3954848c3a92e871f7f8d8aeec9b60dcba49.tar.xz
org.eclipse.osee-0cee3954848c3a92e871f7f8d8aeec9b60dcba49.zip
refinement: Add convenience methods to artifact
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java17
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java4
2 files changed, 21 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index 04284f9fe6..302d7ecf32 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -163,6 +163,12 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
+ public String getAttributeValuesAsString(AttributeTypeId attributeType) {
+ List<Attribute<Object>> attributes = getProxiedObject().getAttributes(attributeType);
+ return Collections.toString(", ", attributes);
+ }
+
+ @Override
public ResultSet<? extends AttributeReadable<Object>> getAttributes() throws OseeCoreException {
List<Attribute<Object>> attributes = getProxiedObject().getAttributes();
return getProxyManager().asExternalAttributes(getSession(), attributes);
@@ -251,6 +257,17 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
+ public List<ArtifactReadable> getRelated(RelationTypeSide relationTypeSide, ArtifactTypeId artifactType) {
+ List<ArtifactReadable> artifacts = new ArrayList<>();
+ for (ArtifactReadable artifact : getRelated(relationTypeSide)) {
+ if (artifact.isOfType(artifactType)) {
+ artifacts.add(artifact);
+ }
+ }
+ return artifacts;
+ }
+
+ @Override
public ResultSet<RelationReadable> getRelations(RelationTypeSide typeAndSide) {
return new ResultSetList<RelationReadable>(Collections.castAll(
getRelationManager().getRelations(getSession(), getProxiedObject(), DeletionFlag.EXCLUDE_DELETED)));
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 445938857b..a5ac1d0f7e 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -71,6 +71,8 @@ public interface ArtifactReadable extends ArtifactToken, HasTransaction, OrcsRea
ResultSet<? extends AttributeReadable<Object>> getAttributes(DeletionFlag deletionFlag) throws OseeCoreException;
+ String getAttributeValuesAsString(AttributeTypeId attributeType);
+
<T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeId attributeType, DeletionFlag deletionFlag) throws OseeCoreException;
////////////////////
@@ -92,6 +94,8 @@ public interface ArtifactReadable extends ArtifactToken, HasTransaction, OrcsRea
ResultSet<ArtifactReadable> getRelated(RelationTypeSide relationTypeSide) throws OseeCoreException;
+ List<ArtifactReadable> getRelated(RelationTypeSide relationTypeSide, ArtifactTypeId artifactType);
+
ResultSet<ArtifactReadable> getRelated(RelationTypeSide relationTypeSide, DeletionFlag deletionFlag) throws OseeCoreException;
boolean areRelated(RelationTypeSide typeAndSide, ArtifactReadable readable) throws OseeCoreException;

Back to the top