Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2019-05-11 22:40:30 +0000
committerRyan D. Brooks2020-12-15 21:44:48 +0000
commit0469f27d143e3474cc5d1d0b3ccb9181c463762c (patch)
treeece61f57957b1dd86269c031ae1464af454d3331
parent1d99a4b54502f196ad1a9857ad7183404b5d55eb (diff)
downloadorg.eclipse.osee-0469f27d143e3474cc5d1d0b3ccb9181c463762c.tar.gz
org.eclipse.osee-0469f27d143e3474cc5d1d0b3ccb9181c463762c.tar.xz
org.eclipse.osee-0469f27d143e3474cc5d1d0b3ccb9181c463762c.zip
refactor: Use generics with AttributeTypeToken
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java18
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/CompletedCancelledByColumn.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/commit/operations/CommitOverrideOperationsImpl.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/UserRoleManager.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractNumericTotalColumn.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/search/internal/query/AtsQueryServiceImpl.java14
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/internal/AtsAttributeResolverServiceImpl.java10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/operations/SprintConfigOperations.java4
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java6
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java26
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/operations/ActionOperations.java7
-rw-r--r--plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/SafetyInformationAccumulator.java2
-rw-r--r--plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceInformationAccumulator.java2
-rw-r--r--plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceReportGenerator.java4
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeGeneric.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeToken.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java3
-rw-r--r--plugins/org.eclipse.osee.framework.server.ide/src/org/eclipse/osee/framework/server/ide/internal/ClientEndpointImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountArtifact.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientArtifact.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java21
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java42
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java64
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java29
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/AttributeEndpointImpl.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/TypesEndpointImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java15
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java28
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadableImpl.java35
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java4
47 files changed, 246 insertions, 243 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
index 81d0d475729..12da3a5c886 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
@@ -44,17 +44,17 @@ public interface IAttributeResolver {
return getAttributeValues(artifact, artifactReferencedAttributeType);
}
- <T> T getSoleAttributeValue(IAtsObject atsObject, AttributeTypeToken attributeType, T defaultReturnValue);
+ <T> T getSoleAttributeValue(IAtsObject atsObject, AttributeTypeToken<T> attributeType, T defaultReturnValue);
List<String> getAttributesToStringList(IAtsObject atsObject, AttributeTypeToken attributeType);
- boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeToken attributeType);
+ boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeToken<?> attributeType);
- String getSoleAttributeValueAsString(IAtsObject atsObject, AttributeTypeToken attributeType, String defaultReturnValue);
+ String getSoleAttributeValueAsString(IAtsObject atsObject, AttributeTypeToken<?> attributeType, String defaultReturnValue);
- int getAttributeCount(IAtsObject atsObject, AttributeTypeToken attributeType);
+ int getAttributeCount(IAtsObject atsObject, AttributeTypeToken<?> attributeType);
- int getAttributeCount(ArtifactId artifact, AttributeTypeToken attributeType);
+ int getAttributeCount(ArtifactId artifact, AttributeTypeToken<?> attributeType);
void addAttribute(IAtsWorkItem workItem, AttributeTypeId attributeType, Object value);
@@ -62,9 +62,9 @@ public interface IAttributeResolver {
<T> Collection<IAttribute<T>> getAttributes(IAtsWorkItem workItem);
- <T> Collection<IAttribute<T>> getAttributes(IAtsObject atsObject, AttributeTypeToken attributeType);
+ <T> Collection<IAttribute<T>> getAttributes(IAtsObject atsObject, AttributeTypeToken<T> attributeType);
- <T> Collection<IAttribute<T>> getAttributes(ArtifactId artifact, AttributeTypeToken attributeType);
+ <T> Collection<IAttribute<T>> getAttributes(ArtifactId artifact, AttributeTypeToken<T> attributeType);
void deleteSoleAttribute(IAtsWorkItem workItem, AttributeTypeId attributeType);
@@ -86,13 +86,13 @@ public interface IAttributeResolver {
void setSoleAttributeValue(IAtsObject atsObject, AttributeTypeId attributeType, Object value);
- <T> T getSoleAttributeValue(ArtifactId artifact, AttributeTypeToken attributeType, T defaultValue);
+ <T> T getSoleAttributeValue(ArtifactId artifact, AttributeTypeToken<T> attributeType, T defaultValue);
<T> Collection<T> getAttributeValues(ArtifactId artifact, AttributeTypeToken attributeType);
<T> Collection<T> getAttributeValues(IAtsObject atsObject, AttributeTypeToken attributeType);
- String getSoleAttributeValueAsString(ArtifactId artifact, AttributeTypeToken attributeType, String defaultReturnValue);
+ String getSoleAttributeValueAsString(ArtifactId artifact, AttributeTypeToken<?> attributeType, String defaultReturnValue);
int getAttributeCount(IAtsWorkItem workItem, AttributeTypeToken attributeType);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/CompletedCancelledByColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/CompletedCancelledByColumn.java
index f07f089603c..876e3401faa 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/CompletedCancelledByColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/CompletedCancelledByColumn.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.AtsUser;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeString;
import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
@@ -45,7 +45,7 @@ public class CompletedCancelledByColumn extends AbstractServicesColumn {
String userId = null;
if (obj instanceof IAtsWorkItem) {
IAtsWorkItem workItem = (IAtsWorkItem) obj;
- AttributeTypeToken type = null;
+ AttributeTypeString type = null;
if (workItem.isCompleted()) {
type = AtsAttributeTypes.CompletedBy;
} else if (workItem.isCancelled()) {
@@ -60,4 +60,4 @@ public class CompletedCancelledByColumn extends AbstractServicesColumn {
}
return null;
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/commit/operations/CommitOverrideOperationsImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/commit/operations/CommitOverrideOperationsImpl.java
index 4c2005c631c..5254f96dd45 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/commit/operations/CommitOverrideOperationsImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/commit/operations/CommitOverrideOperationsImpl.java
@@ -111,9 +111,9 @@ public class CommitOverrideOperationsImpl implements CommitOverrideOperations {
try {
IAtsChangeSet changes = atsApi.createChangeSet("Remove Commit Override");
- for (IAttribute<Object> attr : atsApi.getAttributeResolver().getAttributes(teamWf,
+ for (IAttribute<String> attr : atsApi.getAttributeResolver().getAttributes(teamWf,
AtsAttributeTypes.CommitOverride)) {
- String jsonValue = (String) attr.getValue();
+ String jsonValue = attr.getValue();
CommitOverride or = mapper.readValue(jsonValue, CommitOverride.class);
if (or.getBranchId().equals(branch.getIdString())) {
@@ -127,5 +127,4 @@ public class CommitOverrideOperationsImpl implements CommitOverrideOperations {
}
return Result.TrueResult;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/UserRoleManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/UserRoleManager.java
index d81ce78bbb4..c2f1db6870a 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/UserRoleManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/UserRoleManager.java
@@ -139,8 +139,8 @@ public class UserRoleManager implements IAtsPeerReviewRoleManager {
private List<UserRole> getStoredUserRoles() {
// Add new ones: items in userRoles that are not in dbuserRoles
List<UserRole> storedUserRoles = new ArrayList<>();
- for (IAttribute<Object> attr : atsApi.getAttributeResolver().getAttributes(peerRev, AtsAttributeTypes.Role)) {
- UserRole storedRole = new UserRole((String) attr.getValue());
+ for (IAttribute<String> attr : atsApi.getAttributeResolver().getAttributes(peerRev, AtsAttributeTypes.Role)) {
+ UserRole storedRole = new UserRole(attr.getValue());
storedUserRoles.add(storedRole);
}
return storedUserRoles;
@@ -152,8 +152,8 @@ public class UserRoleManager implements IAtsPeerReviewRoleManager {
List<UserRole> storedUserRoles = getStoredUserRoles();
// Change existing ones
- for (IAttribute<Object> attr : atsApi.getAttributeResolver().getAttributes(peerRev, AtsAttributeTypes.Role)) {
- UserRole storedRole = new UserRole((String) attr.getValue());
+ for (IAttribute<String> attr : atsApi.getAttributeResolver().getAttributes(peerRev, AtsAttributeTypes.Role)) {
+ UserRole storedRole = new UserRole(attr.getValue());
for (UserRole pItem : getUserRoles()) {
if (pItem.equals(storedRole)) {
changes.setAttribute(peerRev, attr, AXml.addTagData(ROLE_ITEM_TAG, pItem.toXml()));
@@ -165,9 +165,9 @@ public class UserRoleManager implements IAtsPeerReviewRoleManager {
// Remove deleted ones; items in dbuserRoles that are not in userRoles
for (UserRole delUserRole : org.eclipse.osee.framework.jdk.core.util.Collections.setComplement(
updatedStoredUserRoles, userRoles)) {
- for (IAttribute<Object> attr : atsApi.getAttributeResolver().getAttributes(peerRev,
+ for (IAttribute<String> attr : atsApi.getAttributeResolver().getAttributes(peerRev,
AtsAttributeTypes.Role)) {
- UserRole storedRole = new UserRole((String) attr.getValue());
+ UserRole storedRole = new UserRole(attr.getValue());
if (storedRole.equals(delUserRole)) {
changes.deleteAttribute(peerRev, attr);
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java
index 148dfa0804d..58aef98398b 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java
@@ -415,7 +415,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
teamWf.reloadAttributesAndRelations();
teamWf = testAttributeTypeMatchesRestAttributes(AtsAttributeTypes.PercentRework);
Assert.assertEquals((Integer) 4, AtsApiService.get().getAttributeResolver().getSoleAttributeValue(
- (IAtsObject) teamWf, AtsAttributeTypes.PercentRework, 1.0));
+ (IAtsObject) teamWf, AtsAttributeTypes.PercentRework, 1));
}
@Test
@@ -442,7 +442,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
teamWf.reloadAttributesAndRelations();
teamWf = testAttributeTypeMatchesRestAttributes(AtsAttributeTypes.NeedBy);
- Date date2 = (Date) AtsApiService.get().getAttributeResolver().getSoleAttributeValue((IAtsObject) teamWf,
+ Date date2 = AtsApiService.get().getAttributeResolver().getSoleAttributeValue((IAtsObject) teamWf,
AtsAttributeTypes.NeedBy, null);
Long dateTime = date2.getTime();
Assert.assertEquals(446579845, dateTime.intValue());
@@ -654,7 +654,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
AtsApiService.get().getAttributeResolver().getSoleAttributeValue(teamWf, AtsAttributeTypes.Priority, ""));
Assert.assertEquals(ai, teamWf.getActionableItems().iterator().next());
Assert.assertEquals(needBy,
- AtsApiService.get().getAttributeResolver().getSoleAttributeValue(teamWf, AtsAttributeTypes.NeedBy, ""));
+ AtsApiService.get().getAttributeResolver().getSoleAttributeValue(teamWf, AtsAttributeTypes.NeedBy, null));
Assert.assertEquals("Blue Team",
AtsApiService.get().getAttributeResolver().getSoleAttributeValue(teamWf, AtsAttributeTypes.ColorTeam, ""));
Assert.assertEquals("My IPT",
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractNumericTotalColumn.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractNumericTotalColumn.java
index 7c3d6f61837..c04f33498d1 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractNumericTotalColumn.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractNumericTotalColumn.java
@@ -44,9 +44,9 @@ import org.eclipse.swt.widgets.TreeItem;
public abstract class AbstractNumericTotalColumn extends XViewerAtsColumn implements IXViewerValueColumn, IAltLeftClickProvider {
private final String calulationStr;
- private final AttributeTypeToken pointsAttrType;
+ private final AttributeTypeToken<?> pointsAttrType;
- public AbstractNumericTotalColumn(String id, String name, String description, String calulationStr, AttributeTypeToken pointsAttrType) {
+ public AbstractNumericTotalColumn(String id, String name, String description, String calulationStr, AttributeTypeToken<?> pointsAttrType) {
super(id, name, 40, XViewerAlign.Center, false, SortDataType.Float, false, description);
this.calulationStr = calulationStr;
this.pointsAttrType = pointsAttrType;
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/search/internal/query/AtsQueryServiceImpl.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/search/internal/query/AtsQueryServiceImpl.java
index ba4308f221a..c221f421a71 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/search/internal/query/AtsQueryServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/search/internal/query/AtsQueryServiceImpl.java
@@ -131,7 +131,7 @@ public class AtsQueryServiceImpl extends AbstractAtsQueryService {
TransactionId transaction = TransactionId.SENTINEL;
try {
- IAttribute<Object> attr = getAttrById(userArt, data.getId());
+ IAttribute<String> attr = getAttrById(userArt, data.getId());
if (attr == null) {
changes.addAttribute(userArt, CoreAttributeTypes.AtsActionSearch, jaxRsApi.toJson(data));
} else {
@@ -147,10 +147,10 @@ public class AtsQueryServiceImpl extends AbstractAtsQueryService {
return transaction;
}
- private IAttribute<Object> getAttrById(ArtifactId artifact, Long attrId) {
- for (IAttribute<Object> attr : atsApi.getAttributeResolver().getAttributes(artifact,
+ private IAttribute<String> getAttrById(ArtifactId artifact, Long attrId) {
+ for (IAttribute<String> attr : atsApi.getAttributeResolver().getAttributes(artifact,
CoreAttributeTypes.AtsActionSearch)) {
- String jsonValue = (String) attr.getValue();
+ String jsonValue = attr.getValue();
try {
AtsSearchData data = fromJson(jsonValue);
if (attrId.equals(data.getId())) {
@@ -171,7 +171,7 @@ public class AtsQueryServiceImpl extends AbstractAtsQueryService {
TransactionId transaction = TransactionId.SENTINEL;
try {
- IAttribute<Object> attr = getAttrById(userArt, data.getId());
+ IAttribute<String> attr = getAttrById(userArt, data.getId());
if (attr != null) {
changes.deleteAttribute(userArt, attr);
transaction = changes.execute();
@@ -187,9 +187,9 @@ public class AtsQueryServiceImpl extends AbstractAtsQueryService {
public AtsSearchData getSearch(AtsUser atsUser, Long id) {
try {
ArtifactId userArt = atsApi.getStoreObject(atsUser);
- IAttribute<Object> attr = getAttrById(userArt, id);
+ IAttribute<String> attr = getAttrById(userArt, id);
if (attr != null) {
- AtsSearchData existing = fromJson((String) attr.getValue());
+ AtsSearchData existing = fromJson(attr.getValue());
if (existing != null) {
return existing;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/internal/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/internal/AtsAttributeResolverServiceImpl.java
index 1c37aacd8d0..06d6be3029e 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/internal/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/internal/AtsAttributeResolverServiceImpl.java
@@ -38,7 +38,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolverServiceImpl {
@Override
- public <T> T getSoleAttributeValue(IAtsObject atsObject, AttributeTypeToken attributeType, T defaultReturnValue) {
+ public <T> T getSoleAttributeValue(IAtsObject atsObject, AttributeTypeToken<T> attributeType, T defaultReturnValue) {
return getArtifact(atsObject).getSoleAttributeValue(attributeType, defaultReturnValue);
}
@@ -127,7 +127,7 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
@SuppressWarnings({"unchecked"})
@Override
- public <T> Collection<IAttribute<T>> getAttributes(IAtsObject atsObject, AttributeTypeToken attributeType) {
+ public <T> Collection<IAttribute<T>> getAttributes(IAtsObject atsObject, AttributeTypeToken<T> attributeType) {
List<IAttribute<T>> attrs = new ArrayList<>();
for (Attribute<Object> attr : getArtifact(atsObject).getAttributes(attributeType)) {
attrs.add((IAttribute<T>) attr);
@@ -214,7 +214,7 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
}
@Override
- public <T> T getSoleAttributeValue(ArtifactId artifact, AttributeTypeToken attributeType, T defaultValue) {
+ public <T> T getSoleAttributeValue(ArtifactId artifact, AttributeTypeToken<T> attributeType, T defaultValue) {
if (getArtifact(artifact) != null) {
return getArtifact(artifact).getSoleAttributeValue(attributeType, defaultValue);
}
@@ -237,11 +237,11 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
@SuppressWarnings({"unchecked"})
@Override
- public <T> Collection<IAttribute<T>> getAttributes(ArtifactId artifact, AttributeTypeToken attributeType) {
+ public <T> Collection<IAttribute<T>> getAttributes(ArtifactId artifact, AttributeTypeToken<T> attributeType) {
Assert.isNotNull(artifact, "Artifact can not be null");
Assert.isNotNull(attributeType, "Attribute Type can not be null");
List<IAttribute<T>> attributes = new LinkedList<>();
- for (Attribute<Object> attr : getArtifact(artifact).getAttributes(attributeType)) {
+ for (Attribute<?> attr : getArtifact(artifact).getAttributes(attributeType)) {
attributes.add((IAttribute<T>) attr);
}
return attributes;
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/operations/SprintConfigOperations.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/operations/SprintConfigOperations.java
index 4a73ea46d09..59b54b49b07 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/operations/SprintConfigOperations.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/operations/SprintConfigOperations.java
@@ -94,7 +94,7 @@ public class SprintConfigOperations {
return sprintConfig;
}
- private void updatePointsIfNecessary(String newPointsStr, SprintConfigurations sprintConfig, IAgileSprint sprint, AttributeTypeToken attrType, IAtsChangeSet changes) {
+ private void updatePointsIfNecessary(String newPointsStr, SprintConfigurations sprintConfig, IAgileSprint sprint, AttributeTypeToken<Integer> attrType, IAtsChangeSet changes) {
if (Strings.isValid(newPointsStr)) {
try {
if (Strings.isInValid(newPointsStr)) {
@@ -117,7 +117,7 @@ public class SprintConfigOperations {
}
}
- private void updateDateIfNecessary(String newDateStr, SprintConfigurations sprintConfig, IAgileSprint sprint, AttributeTypeToken attrType, IAtsChangeSet changes) {
+ private void updateDateIfNecessary(String newDateStr, SprintConfigurations sprintConfig, IAgileSprint sprint, AttributeTypeToken<Date> attrType, IAtsChangeSet changes) {
if (Strings.isValid(newDateStr)) {
try {
if (Strings.isInValid(newDateStr)) {
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
index 2662688eafb..6ce4ee8be04 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
@@ -112,13 +112,13 @@ public class UpdateAtsConfiguration {
TransactionBuilder tx = orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON, userId,
"Create Update Config Attributes");
- Iterator<? extends AttributeReadable<Object>> iterator =
+ Iterator<? extends AttributeReadable<String>> iterator =
configArt.getAttributes(CoreAttributeTypes.GeneralStringData, DeletionFlag.EXCLUDE_DELETED).iterator();
boolean found = false;
while (iterator.hasNext()) {
- AttributeReadable<Object> attributeReadable = iterator.next();
+ AttributeReadable<String> attributeReadable = iterator.next();
- if (attributeReadable != null && ((String) attributeReadable.getValue()).startsWith(VIEWS_EQUAL_KEY)) {
+ if (attributeReadable != null && attributeReadable.getValue().startsWith(VIEWS_EQUAL_KEY)) {
tx.setAttributeById(configArt, attributeReadable, getViewsAttrValue(databaseViews));
rd.log("Create or update AtsConfig.VIEWS attribute\n");
found = true;
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
index e3334543d2d..b964511f0a9 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
@@ -63,7 +63,7 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
}
@Override
- public <T> T getSoleAttributeValue(IAtsObject atsObject, AttributeTypeToken attributeType, T defaultReturnValue) {
+ public <T> T getSoleAttributeValue(IAtsObject atsObject, AttributeTypeToken<T> attributeType, T defaultReturnValue) {
return getArtifact(atsObject).getSoleAttributeValue(attributeType, defaultReturnValue);
}
@@ -79,13 +79,13 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
}
@Override
- public String getSoleAttributeValueAsString(IAtsObject atsObject, AttributeTypeToken attributeType, String defaultValue) {
- return getArtifact(atsObject).getAttributeValuesAsString(attributeType);
+ public String getSoleAttributeValueAsString(IAtsObject atsObject, AttributeTypeToken<?> attributeType, String defaultValue) {
+ return getArtifact(atsObject).getSoleAttributeAsString(attributeType, defaultValue);
}
@Override
- public String getSoleAttributeValueAsString(ArtifactId artifact, AttributeTypeToken attributeType, String defaultValue) {
- return getArtifact(artifact).getSoleAttributeValue(attributeType, defaultValue);
+ public String getSoleAttributeValueAsString(ArtifactId artifact, AttributeTypeToken<?> attributeType, String defaultValue) {
+ return getArtifact(artifact).getSoleAttributeAsString(attributeType, defaultValue);
}
@Override
@@ -116,12 +116,11 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
throw new OseeStateException("Not Implemented");
}
- @SuppressWarnings("unchecked")
@Override
- public <T> Collection<IAttribute<T>> getAttributes(IAtsObject atsObject, AttributeTypeToken attributeType) {
+ public <T> Collection<IAttribute<T>> getAttributes(IAtsObject atsObject, AttributeTypeToken<T> attributeType) {
Collection<IAttribute<T>> attrs = new ArrayList<>();
- for (AttributeReadable<Object> attr : getArtifact(atsObject).getAttributes(attributeType)) {
- attrs.add((IAttribute<T>) attr);
+ for (AttributeReadable<T> attr : getArtifact(atsObject).getAttributes(attributeType)) {
+ attrs.add(attr);
}
return attrs;
}
@@ -177,7 +176,7 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
}
@Override
- public <T> T getSoleAttributeValue(ArtifactId artifact, AttributeTypeToken attributeType, T defaultValue) {
+ public <T> T getSoleAttributeValue(ArtifactId artifact, AttributeTypeToken<T> attributeType, T defaultValue) {
return getArtifact(artifact).getSoleAttributeValue(attributeType, defaultValue);
}
@@ -191,15 +190,12 @@ public class AtsAttributeResolverServiceImpl extends AbstractAtsAttributeResolve
return getAttributeValues(atsObject.getStoreObject(), attributeType);
}
- @SuppressWarnings("unchecked")
@Override
- public <T> Collection<IAttribute<T>> getAttributes(ArtifactId artifact, AttributeTypeToken attributeType) {
+ public <T> Collection<IAttribute<T>> getAttributes(ArtifactId artifact, AttributeTypeToken<T> attributeType) {
Assert.isNotNull(artifact, "Artifact can not be null");
Assert.isNotNull(attributeType, "Attribute Type can not be null");
List<IAttribute<T>> attributes = new LinkedList<>();
- for (AttributeReadable<Object> attr : ((ArtifactReadable) artifact).getAttributes(attributeType)) {
- attributes.add((IAttribute<T>) attr);
- }
+ ((ArtifactReadable) artifact).getAttributes(attributeType).forEach(attributes::add);
return attributes;
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/operations/ActionOperations.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/operations/ActionOperations.java
index f3a8bc64a12..e03abd2048f 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/operations/ActionOperations.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/operations/ActionOperations.java
@@ -65,7 +65,7 @@ public class ActionOperations {
public Attribute setActionAttributeByType(String id, String attrTypeIdOrKey, List<String> values) {
Conditions.assertNotNull(values, "values can not be null");
IAtsChangeSet changes = atsApi.createChangeSet("set attr by type or key " + attrTypeIdOrKey);
- AttributeTypeGeneric<?> attrTypeId = null;
+ AttributeTypeToken<?> attrTypeId = null;
if (attrTypeIdOrKey.equals(AttributeKey.Title.name())) {
changes.setSoleAttributeValue(workItem, CoreAttributeTypes.Name, values.iterator().next());
attrTypeId = CoreAttributeTypes.Name;
@@ -194,11 +194,12 @@ public class ActionOperations {
return null;
}
- private AttributeTypeGeneric<?> getAttributeType(String id) {
+ private AttributeTypeToken<?> getAttributeType(String id) {
return orcsApi.tokenService().getAttributeType(Long.valueOf(id));
}
- public Attribute getActionAttributeValues(AttributeTypeToken attributeType, IAtsWorkItem workItem) {
+ public Attribute getActionAttributeValues(AttributeTypeToken<?> attributeType, IAtsWorkItem workItem) {
+ private Attribute getActionAttributeValues(AttributeTypeToken<?> attrType, IAtsWorkItem workItem) {
Attribute attribute = new Attribute();
attribute.setArtId(workItem.getStoreObject());
attribute.setAttributeType(attributeType);
diff --git a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/SafetyInformationAccumulator.java b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/SafetyInformationAccumulator.java
index f9a0d405037..116e3e13149 100644
--- a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/SafetyInformationAccumulator.java
+++ b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/SafetyInformationAccumulator.java
@@ -180,7 +180,7 @@ public final class SafetyInformationAccumulator {
writer.writeRow((Object[]) currentRowValues);
}
- private String writeCriticality(ArtifactReadable art, AttributeTypeToken thisType, String[] currentRowValues, int col) {
+ private String writeCriticality(ArtifactReadable art, AttributeTypeToken<?> thisType, String[] currentRowValues, int col) {
String current = art.getSoleAttributeAsString(thisType, "Error");
if ("Error".equals(current)) {
writeCell("Error: invalid content", currentRowValues, col);
diff --git a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceInformationAccumulator.java b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceInformationAccumulator.java
index ba59f06a583..bd1b2d078f9 100644
--- a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceInformationAccumulator.java
+++ b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceInformationAccumulator.java
@@ -134,7 +134,7 @@ public class TraceInformationAccumulator {
public String handleEquivalentName(ArtifactReadable softwareRequirement) {
String toReturn = softwareRequirement.getName();
if (softwareRequirement.isOfType(traceReport.getAlternateArtifactType())) {
- AttributeTypeToken attrType = traceReport.getAlternateAttributeType();
+ AttributeTypeToken<?> attrType = traceReport.getAlternateAttributeType();
if (attrType != null) {
toReturn = softwareRequirement.getSoleAttributeAsString(attrType, toReturn);
}
diff --git a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceReportGenerator.java b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceReportGenerator.java
index f4d3e807bc9..d3be912afac 100644
--- a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceReportGenerator.java
+++ b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/internal/TraceReportGenerator.java
@@ -42,7 +42,7 @@ public class TraceReportGenerator {
private final TraceMatch traceMatch;
private final TraceAccumulator testTraces;
private final ArtifactTypeToken alternateArtifactType;
- private final AttributeTypeToken alternateAttributeType;
+ private final AttributeTypeToken<?> alternateAttributeType;
public static int SOFTWARE_SHEETREQ_INDEX = 3;
public static int SOFTWARE_REQUIREMENT_INDEX = 4;
@@ -207,7 +207,7 @@ public class TraceReportGenerator {
return alternateArtifactType;
}
- public AttributeTypeToken getAlternateAttributeType() {
+ public AttributeTypeToken<?> getAlternateAttributeType() {
return alternateAttributeType;
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index ccf9b2d5688..abcaf4ebcaa 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -583,7 +583,7 @@ public class OrcsStorageImpl implements Storage {
ArtifactReadable newRerpotArt =
getQuery().fromBranch(branch).fromTransaction(commit).andId(reportArt).getResults().getExactlyOne();
- AttributeReadable<Object> contentsAsAttribute =
+ AttributeReadable<String> contentsAsAttribute =
newRerpotArt.getAttributes(CoreAttributeTypes.GeneralStringData).getExactlyOne();
toReturn = String.format("/orcs/branch/%s/artifact/%s/attribute/%s/version/%s", branch, newRerpotArt.getGuid(),
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeGeneric.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeGeneric.java
index 4366a4213f5..a635c8a1fa4 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeGeneric.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeGeneric.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.jdk.core.type.NamedIdDescription;
/**
* @author Ryan D. Brooks
*/
-public abstract class AttributeTypeGeneric<T> extends NamedIdDescription implements AttributeTypeToken {
+public abstract class AttributeTypeGeneric<T> extends NamedIdDescription implements AttributeTypeToken<T> {
public static final AttributeTypeString SENTINEL =
AttributeTypeToken.createString(Id.SENTINEL, NamespaceToken.OSEE, Named.SENTINEL, Named.SENTINEL, "", "");
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeToken.java
index b6ea73fd6bd..ef857134c19 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeToken.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeToken.java
@@ -26,8 +26,8 @@ import org.eclipse.osee.framework.jdk.core.type.NamedId;
/**
* @author Ryan D. Brooks
*/
-
-public interface AttributeTypeToken extends AttributeTypeId, FullyNamed, HasDescription, NamedId {
+public interface AttributeTypeToken<T> extends AttributeTypeId, FullyNamed, HasDescription, NamedId {
+ static final AttributeTypeToken<Object> SENTINEL = valueOf(Id.SENTINEL, Named.SENTINEL);
static final AttributeTypeGeneric<?> SENTINEL = valueOf(Id.SENTINEL, Named.SENTINEL);
static final String APPLICATION_ZIP = "application/zip";
static final String TEXT_CALENDAR = "text/calendar";
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java
index 02eb6b58783..334659ce639 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java
@@ -22,6 +22,9 @@ import org.eclipse.osee.framework.core.data.AttributeTypeInputStream;
import org.eclipse.osee.framework.core.data.AttributeTypeInteger;
import org.eclipse.osee.framework.core.data.AttributeTypeJoin;
import org.eclipse.osee.framework.core.data.AttributeTypeString;
+import java.io.InputStream;
+import java.util.Date;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.DynamicEnumAttributeType;
import org.eclipse.osee.framework.core.enums.token.ComponentAttributeType;
diff --git a/plugins/org.eclipse.osee.framework.server.ide/src/org/eclipse/osee/framework/server/ide/internal/ClientEndpointImpl.java b/plugins/org.eclipse.osee.framework.server.ide/src/org/eclipse/osee/framework/server/ide/internal/ClientEndpointImpl.java
index b32915d4e79..759b697acda 100644
--- a/plugins/org.eclipse.osee.framework.server.ide/src/org/eclipse/osee/framework/server/ide/internal/ClientEndpointImpl.java
+++ b/plugins/org.eclipse.osee.framework.server.ide/src/org/eclipse/osee/framework/server/ide/internal/ClientEndpointImpl.java
@@ -171,7 +171,8 @@ public class ClientEndpointImpl implements ClientEndpoint {
for (ArtifactReadable userArt : orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andTypeEquals(
CoreArtifactTypes.User).and(CoreAttributeTypes.Name, userIdOrName,
QueryOption.CONTAINS_MATCH_OPTIONS).getResults()) {
- results.add(userArt.getSoleAttributeValue(CoreAttributeTypes.UserId, null));
+ String defaultValue = null;
+ results.add(userArt.getSoleAttributeValue(CoreAttributeTypes.UserId, defaultValue));
}
}
return results;
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountArtifact.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountArtifact.java
index f1096e1cd9e..79546d839ac 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountArtifact.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountArtifact.java
@@ -41,7 +41,7 @@ public class AccountArtifact extends BaseId implements Account, ArtifactId {
@Override
public boolean isActive() {
- return artifact.getSoleAttributeValue(CoreAttributeTypes.Active, false);
+ return artifact.getSoleAttributeValue(CoreAttributeTypes.Active, Boolean.FALSE);
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientArtifact.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientArtifact.java
index 9e3801b0a65..21a644bc6a4 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientArtifact.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientArtifact.java
@@ -139,5 +139,4 @@ public class ClientArtifact extends BaseIdentity<String> implements OAuthClient
public InputStream getInput() {
return artifact.getSoleAttributeValue(CoreAttributeTypes.ImageContent);
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
index 753187fe299..a74e2610601 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
@@ -78,7 +78,7 @@ public class ArtifactFactoryTest {
private String guid;
private ArtifactFactory artifactFactory;
- private List<AttributeTypeToken> types;
+ private List<AttributeTypeToken<?>> types;
@Before
public void init() {
@@ -209,15 +209,15 @@ public class ArtifactFactoryTest {
}
};
- private static final class ReturnExistingTypes implements Answer<List<AttributeTypeToken>> {
- private final List<AttributeTypeToken> types;
+ private static final class ReturnExistingTypes implements Answer<List<AttributeTypeToken<?>>> {
+ private final List<AttributeTypeToken<?>> types;
- public ReturnExistingTypes(List<AttributeTypeToken> types) {
+ public ReturnExistingTypes(List<AttributeTypeToken<?>> types) {
this.types = types;
}
@Override
- public List<AttributeTypeToken> answer(InvocationOnMock invocation) throws Throwable {
+ public List<AttributeTypeToken<?>> answer(InvocationOnMock invocation) throws Throwable {
return types;
}
};
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
index 3a4d3256b43..d7d63ef070f 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
@@ -73,10 +73,10 @@ public class ArtifactTest {
@SuppressWarnings("rawtypes")
@Mock private Attribute attribute;
+ @Mock private Attribute<Integer> integerAttribute;
+ @Mock private Attribute<String> notDeleted;
@SuppressWarnings("rawtypes")
- @Mock private Attribute notDeleted;
- @SuppressWarnings("rawtypes")
- @Mock private Attribute deleted;
+ @Mock private Attribute<String> deleted;
@SuppressWarnings("rawtypes")
@Mock private Attribute differentType;
@@ -118,7 +118,7 @@ public class ArtifactTest {
@Test
@SuppressWarnings("unchecked")
public void testAddAndGet() {
- Attribute<Object> attribute = mock(Attribute.class);
+ Attribute<String> attribute = mock(Attribute.class);
when(attribute.getOrcsData()).thenReturn(attributeData);
Assert.assertEquals(0, artifact.getAttributes().size());
artifact.add(CoreAttributeTypes.GeneralStringData, attribute);
@@ -142,7 +142,7 @@ public class ArtifactTest {
@Test
@SuppressWarnings("unchecked")
public void testAreAttributesDirty() {
- Attribute<Object> attribute = mock(Attribute.class);
+ Attribute<String> attribute = mock(Attribute.class);
when(attribute.getOrcsData()).thenReturn(attributeData);
artifact.add(CoreAttributeTypes.GeneralStringData, attribute);
Assert.assertFalse(artifact.areAttributesDirty());
@@ -311,9 +311,9 @@ public class ArtifactTest {
Assert.assertTrue(attributes.contains(differentType));
Assert.assertFalse(attributes.contains(deleted));
- attributes = artifact.getAttributes(CoreAttributeTypes.AccessContextId);
- Assert.assertEquals(1, attributes.size());
- Assert.assertTrue(attributes.contains(notDeleted));
+ List<Attribute<String>> attributes2 = artifact.getAttributes(CoreAttributeTypes.AccessContextId);
+ Assert.assertEquals(1, attributes2.size());
+ Assert.assertTrue(attributes2.contains(notDeleted));
}
@Test
@@ -322,16 +322,16 @@ public class ArtifactTest {
artifact.add(CoreAttributeTypes.AccessContextId, deleted);
when(notDeleted.getValue()).thenReturn("notDeleted");
when(deleted.getValue()).thenReturn("deleted");
- List<Object> values = artifact.getAttributeValues(CoreAttributeTypes.AccessContextId);
+ List<String> values = artifact.getAttributeValues(CoreAttributeTypes.AccessContextId);
Assert.assertEquals(1, values.size());
Assert.assertTrue(values.contains("notDeleted"));
}
@Test
public void testGetSoleAttributeAsString() {
- when(notDeleted.getValue()).thenReturn(new Integer(5));
- artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
- String attribute = artifact.getSoleAttributeAsString(CoreAttributeTypes.AccessContextId);
+ when(integerAttribute.getValue()).thenReturn(new Integer(5));
+ artifact.add(CoreAttributeTypes.ReviewId, integerAttribute);
+ String attribute = artifact.getSoleAttributeAsString(CoreAttributeTypes.ReviewId);
Assert.assertEquals("5", attribute);
attribute = artifact.getSoleAttributeAsString(CoreAttributeTypes.Category, "default");
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
index a683644f93f..6acda174ba5 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
@@ -160,7 +160,7 @@ public class ArtifactReadOnlyImplTest {
List<? extends AttributeTypeId> types = Arrays.asList(Active, Name);
when(proxiedObject.getExistingAttributeTypes()).thenAnswer(answer(types));
- Collection<AttributeTypeToken> actual = readOnly.getExistingAttributeTypes();
+ Collection<? extends AttributeTypeId> actual = readOnly.getExistingAttributeTypes();
assertEquals(types, actual);
verify(proxiedObject).getExistingAttributeTypes();
@@ -171,7 +171,7 @@ public class ArtifactReadOnlyImplTest {
List<? extends AttributeTypeId> types = Arrays.asList(Active, Name, Annotation);
when(proxiedObject.getValidAttributeTypes()).thenAnswer(answer(types));
- Collection<AttributeTypeToken> actual = readOnly.getValidAttributeTypes();
+ Collection<AttributeTypeToken<?>> actual = readOnly.getValidAttributeTypes();
assertEquals(types, actual);
verify(proxiedObject).getValidAttributeTypes();
@@ -395,7 +395,7 @@ public class ArtifactReadOnlyImplTest {
when(proxiedObject.getAttributes(Name)).thenAnswer(answer(attributes1));
when(proxyManager.asExternalAttributes(session, attributes1)).thenAnswer(answer(expected));
- ResultSet<? extends AttributeReadable<Object>> actual = readOnly.getAttributes(Name);
+ ResultSet<? extends AttributeReadable<String>> actual = readOnly.getAttributes(Name);
assertEquals(expected, actual);
verify(proxiedObject).getAttributes(Name);
@@ -409,7 +409,7 @@ public class ArtifactReadOnlyImplTest {
when(proxiedObject.getAttributes(Name, EXCLUDE_DELETED)).thenAnswer(answer(attributes1));
when(proxyManager.asExternalAttributes(session, attributes1)).thenAnswer(answer(expected));
- ResultSet<? extends AttributeReadable<Object>> actual = readOnly.getAttributes(Name, EXCLUDE_DELETED);
+ ResultSet<? extends AttributeReadable<String>> actual = readOnly.getAttributes(Name, EXCLUDE_DELETED);
assertEquals(expected, actual);
verify(proxiedObject).getAttributes(Name, EXCLUDE_DELETED);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java
index 593bf05da2b..31b15ffecd4 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java
@@ -146,7 +146,7 @@ public class TransactionBuilderImplTest {
@Test
public void testCopyArtifactWithList() {
- Collection<AttributeTypeToken> attributesToDuplicate = Arrays.asList(Name, Annotation);
+ Collection<AttributeTypeToken<?>> attributesToDuplicate = Arrays.asList(Name, Annotation);
factory.copyArtifact(expectedAuthor, attributesToDuplicate);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
index 3c4b8c06ec6..ac83ff9eb3a 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
@@ -105,7 +105,7 @@ public class TxDataManagerTest {
private TxDataManager txDataManager;
private TxData txDataReal;
- private final Collection<AttributeTypeToken> types = Arrays.asList(Name, Category);
+ private final Collection<AttributeTypeToken<?>> types = Arrays.asList(Name, Category);
private String r1Guid;
private String r2Guid;
private String r3Guid;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java
index 654c82b8002..4f59939db24 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java
@@ -26,7 +26,7 @@ import org.eclipse.osee.orcs.data.AttributeReadable;
* @author Roberto E. Escobar
* @author Andrew M. Finkbeiner
*/
-public interface Attribute<T> extends OrcsWriteable, AttributeReadable<T>, HasOrcsData<AttributeTypeGeneric<T>, AttributeData<T>> {
+public interface Attribute<T> extends OrcsWriteable, AttributeReadable<T>, HasOrcsData<AttributeTypeToken<T>, AttributeData<T>> {
void setValue(T value);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java
index 7f4885497ed..37628967430 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
/**
* @author Roberto E. Escobar
*/
-public interface AttributeData<T> extends OrcsData<AttributeTypeGeneric<T>>, AttributeId {
+public interface AttributeData<T> extends OrcsData<AttributeTypeToken<T>>, AttributeId {
ArtifactId getArtifactId();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java
index df43b05abad..908853abd78 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java
@@ -84,14 +84,13 @@ public class ArtifactFactory {
return artifact;
}
- public Artifact copyArtifact(OrcsSession session, Artifact source, Collection<AttributeTypeToken> types, BranchId ontoBranch) {
+ public Artifact copyArtifact(OrcsSession session, Artifact source, Collection<AttributeTypeToken<?>> types, BranchId ontoBranch) {
ArtifactData artifactData = factory.copy(ontoBranch, source.getOrcsData());
Artifact copy = createArtifact(session, artifactData);
- Collection<AttributeTypeToken> typesToCopy = getAllowedTypes(copy, types);
- for (AttributeTypeToken attributeType : typesToCopy) {
+ Collection<AttributeTypeToken<?>> typesToCopy = getAllowedTypes(copy, types);
+ for (AttributeTypeToken<?> attributeType : typesToCopy) {
for (AttributeReadable<?> attributeSource : source.getAttributes(attributeType)) {
- AttributeData data = getAttributeData(attributeSource);
- attributeFactory.copyAttribute(data, ontoBranch, copy);
+ attributeFactory.copyAttribute(getAttributeData(attributeSource), ontoBranch, copy);
}
}
copy.setLoaded(true);
@@ -136,9 +135,9 @@ public class ArtifactFactory {
public Artifact clone(OrcsSession session, Artifact source) {
ArtifactData artifactData = factory.clone(source.getOrcsData());
Artifact copy = createArtifact(session, artifactData);
- for (AttributeTypeToken attributeType : source.getExistingAttributeTypes()) {
+ for (AttributeTypeToken<?> attributeType : source.getExistingAttributeTypes()) {
for (AttributeReadable<?> attributeSource : source.getAttributes(attributeType)) {
- AttributeData data = getAttributeData(attributeSource);
+ AttributeData<?> data = getAttributeData(attributeSource);
attributeFactory.cloneAttribute(data, copy);
}
}
@@ -146,13 +145,13 @@ public class ArtifactFactory {
return copy;
}
- private AttributeData getAttributeData(AttributeReadable<?> source) {
+ private AttributeData<?> getAttributeData(AttributeReadable<?> source) {
return ((Attribute<?>) source).getOrcsData();
}
- private Collection<AttributeTypeToken> getAllowedTypes(Artifact destination, Collection<AttributeTypeToken> types) {
- Set<AttributeTypeToken> toReturn = new HashSet<>();
- for (AttributeTypeToken type : types) {
+ private Collection<AttributeTypeToken<?>> getAllowedTypes(Artifact destination, Collection<AttributeTypeToken<?>> types) {
+ Set<AttributeTypeToken<?>> toReturn = new HashSet<>();
+ for (AttributeTypeToken<?> type : types) {
if (type.notEqual(RelationOrder)) {
if (destination.isAttributeTypeValid(type)) {
toReturn.add(type);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
index b3c0ce34c25..73fe817cbab 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
@@ -146,7 +146,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
}
@Override
- public Collection<AttributeTypeToken> getValidAttributeTypes() {
+ public Collection<AttributeTypeToken<?>> getValidAttributeTypes() {
return getArtifactType().getValidAttributeTypes();
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java
index cf6c136e89d..8ab96fcbcf1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java
@@ -24,9 +24,9 @@ import org.eclipse.osee.orcs.core.ds.Attribute;
*/
public interface AttributeContainer extends ArtifactToken {
- <T> void add(AttributeTypeToken attributeType, Attribute<T> attribute);
+ <T> void add(AttributeTypeToken<T> attributeType, Attribute<T> attribute);
- <T> void remove(AttributeTypeToken type, Attribute<T> attribute);
+ <T> void remove(AttributeTypeToken<T> type, Attribute<T> attribute);
boolean isLoaded();
@@ -36,11 +36,11 @@ public interface AttributeContainer extends ArtifactToken {
boolean areAttributesDirty();
- int getAttributeCount(AttributeTypeToken type);
+ <T> int getAttributeCount(AttributeTypeToken<T> type);
- int getAttributeCount(AttributeTypeToken type, DeletionFlag deletionFlag);
+ <T> int getAttributeCount(AttributeTypeToken<T> type, DeletionFlag deletionFlag);
- Collection<AttributeTypeToken> getValidAttributeTypes();
+ Collection<AttributeTypeToken<?>> getValidAttributeTypes();
- Collection<AttributeTypeToken> getExistingAttributeTypes();
+ Collection<AttributeTypeToken<?>> getExistingAttributeTypes();
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
index 405c5fab21a..fd85ff80c77 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
@@ -54,7 +54,7 @@ public class AttributeFactory {
this.tokenService = tokenService;
}
- public <T> Attribute<T> createAttributeWithDefaults(AttributeContainer container, ArtifactData artifactData, AttributeTypeToken attributeType) {
+ public <T> Attribute<T> createAttributeWithDefaults(AttributeContainer container, ArtifactData artifactData, AttributeTypeToken<T> attributeType) {
AttributeData<T> data = dataFactory.create(artifactData, tokenService.getAttributeType(attributeType.getId()));
return createAttribute(container, data, true, true);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
index 6dd96671f82..bd9f418fc02 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
@@ -36,21 +36,21 @@ public interface AttributeManager extends AttributeContainer {
void unDeleteAttributesByArtifact();
- <T> T getSoleAttributeValue(AttributeTypeToken attributeType);
+ <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType);
- <T> T getSoleAttributeValue(AttributeTypeToken attributeType, DeletionFlag flag, T defaultValue);
+ <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, DeletionFlag flag, T defaultValue);
- <T> T getSoleAttributeValue(AttributeTypeToken attributeType, T defaultValue);
+ <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, T defaultValue);
- <T> Attribute<T> getSoleAttribute(AttributeTypeToken attributeType);
+ <T> Attribute<T> getSoleAttribute(AttributeTypeToken<T> attributeType);
- <T> Attribute<T> getSoleAttribute(AttributeTypeToken attributeType, DeletionFlag flag);
+ <T> Attribute<T> getSoleAttribute(AttributeTypeToken<T> attributeType, DeletionFlag flag);
- String getSoleAttributeAsString(AttributeTypeToken attributeType);
+ String getSoleAttributeAsString(AttributeTypeToken<?> attributeType);
- String getSoleAttributeAsString(AttributeTypeToken attributeType, String defaultValue);
+ String getSoleAttributeAsString(AttributeTypeToken<?> attributeType, String defaultValue);
- <T> List<T> getAttributeValues(AttributeTypeToken attributeType);
+ <T> List<T> getAttributeValues(AttributeTypeToken<T> attributeType);
<T> List<T> getAttributeValues(AttributeTypeToken attributeType, DeletionFlag deletionFlag);
@@ -61,35 +61,35 @@ public interface AttributeManager extends AttributeContainer {
return enumValue.matches(values);
}
- <T> void setSoleAttributeValue(AttributeTypeToken attributeType, T value);
+ <T> void setSoleAttributeValue(AttributeTypeToken<T> attributeType, T value);
- void setSoleAttributeFromStream(AttributeTypeToken attributeType, InputStream inputStream);
+ void setSoleAttributeFromStream(AttributeTypeToken<?> attributeType, InputStream inputStream);
- void setSoleAttributeFromString(AttributeTypeToken attributeType, String value);
+ void setSoleAttributeFromString(AttributeTypeToken<?> attributeType, String value);
- <T> void setAttributesFromValues(AttributeTypeToken attributeType, Collection<T> values);
+ <T> void setAttributesFromValues(AttributeTypeToken<T> attributeType, Collection<T> values);
- void setAttributesFromStrings(AttributeTypeToken attributeType, String... values);
+ void setAttributesFromStrings(AttributeTypeToken<?> attributeType, String... values);
- <T> void setAttributesFromStrings(AttributeTypeToken attributeType, Collection<String> values);
+ <T> void setAttributesFromStrings(AttributeTypeToken<T> attributeType, Collection<String> values);
- void deleteSoleAttribute(AttributeTypeToken attributeType);
+ void deleteSoleAttribute(AttributeTypeToken<?> attributeType);
- void deleteAttributes(AttributeTypeToken attributeType);
+ void deleteAttributes(AttributeTypeToken<?> attributeType);
- void deleteAttributesWithValue(AttributeTypeToken attributeType, Object value);
+ void deleteAttributesWithValue(AttributeTypeToken<?> attributeType, Object value);
- <T> Attribute<T> createAttribute(AttributeTypeGeneric<T> attributeType);
+ <T> Attribute<T> createAttribute(AttributeTypeToken<T> attributeType);
- <T> Attribute<T> createAttribute(AttributeTypeToken attributeType, T value);
+ <T> Attribute<T> createAttribute(AttributeTypeToken<T> attributeType, T value);
<T> List<Attribute<T>> getAttributes();
- <T> List<Attribute<T>> getAttributes(AttributeTypeToken attributeType);
+ <T> List<Attribute<T>> getAttributes(AttributeTypeToken<T> attributeType);
<T> List<Attribute<T>> getAttributes(DeletionFlag deletionFlag);
- <T> List<Attribute<T>> getAttributes(AttributeTypeToken attributeType, DeletionFlag deletionFlag);
+ <T> List<Attribute<T>> getAttributes(AttributeTypeToken<T> attributeType, DeletionFlag deletionFlag);
<T> Attribute<T> getAttributeById(AttributeId attributeId);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
index c97fa09432a..5deb51fe83a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
@@ -55,9 +55,9 @@ import org.eclipse.osee.orcs.core.internal.util.OrcsPredicates;
/**
* @author Roberto E. Escobar
*/
-public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData<ArtifactTypeToken, ArtifactData>, AttributeManager, AttributeExceptionFactory, Iterable<Map.Entry<AttributeTypeToken, List<Attribute<?>>>> {
+public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData<ArtifactTypeToken, ArtifactData>, AttributeManager, AttributeExceptionFactory, Iterable<Map.Entry<AttributeTypeToken<?>, List<Attribute<?>>>> {
- private final HashCollection<AttributeTypeToken, Attribute<?>> attributes;
+ private final HashCollection<AttributeTypeToken<?>, Attribute<?>> attributes;
private final String guid;
private boolean isLoaded;
private final ArtifactData artifactData;
@@ -91,13 +91,13 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public synchronized <T> void add(AttributeTypeToken attributeType, Attribute<T> attribute) {
+ public synchronized <T> void add(AttributeTypeToken<T> attributeType, Attribute<T> attribute) {
attributes.put(attributeType, attribute);
attribute.getOrcsData().setArtifactId(this);
}
@Override
- public synchronized <T> void remove(AttributeTypeToken type, Attribute<T> attribute) {
+ public synchronized <T> void remove(AttributeTypeToken<T> type, Attribute<T> attribute) {
attributes.removeValue(type, attribute);
attribute.getOrcsData().setArtifactId(ArtifactId.SENTINEL);
}
@@ -142,8 +142,8 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public Collection<AttributeTypeToken> getExistingAttributeTypes() {
- Collection<AttributeTypeToken> notDeleted = new HashSet<>();
+ public Collection<AttributeTypeToken<?>> getExistingAttributeTypes() {
+ Collection<AttributeTypeToken<?>> notDeleted = new HashSet<>();
for (Attribute<?> attr : attributes.getValues()) {
if (!attr.isDeleted()) {
notDeleted.add(attr.getAttributeType());
@@ -181,27 +181,27 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public <T> List<Attribute<T>> getAttributes(AttributeTypeToken attributeType) {
+ public <T> List<Attribute<T>> getAttributes(AttributeTypeToken<T> attributeType) {
return getAttributes(attributeType, DeletionFlag.EXCLUDE_DELETED);
}
@Override
- public <T> List<Attribute<T>> getAttributes(AttributeTypeToken attributeType, DeletionFlag deletionFlag) {
+ public <T> List<Attribute<T>> getAttributes(AttributeTypeToken<T> attributeType, DeletionFlag deletionFlag) {
return filterAttributes(attributes.getValues(attributeType), deletionFlag);
}
@Override
- public int getAttributeCount(AttributeTypeToken attributeType) {
+ public <T> int getAttributeCount(AttributeTypeToken<T> attributeType) {
return getAttributeCount(attributeType, DeletionFlag.EXCLUDE_DELETED);
}
@Override
- public int getAttributeCount(AttributeTypeToken attributeType, DeletionFlag deletionFlag) {
+ public <T> int getAttributeCount(AttributeTypeToken<T> attributeType, DeletionFlag deletionFlag) {
return filterAttributes(attributes.getValues(attributeType), deletionFlag).size();
}
@Override
- public <T> List<T> getAttributeValues(AttributeTypeToken attributeType) {
+ public <T> List<T> getAttributeValues(AttributeTypeToken<T> attributeType) {
List<Attribute<T>> attributes = getAttributes(attributeType);
List<T> values = new LinkedList<>();
@@ -265,13 +265,13 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType) {
Attribute<T> attribute = getSoleAttribute(attributeType);
return attribute.getValue();
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType, DeletionFlag flag, T defaultValue) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, DeletionFlag flag, T defaultValue) {
T value = defaultValue;
Attribute<T> attribute = null;
try {
@@ -286,7 +286,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
@SuppressWarnings("unchecked")
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType, T defaultValue) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, T defaultValue) {
T value = defaultValue;
List<Attribute<Object>> attributes = getAttributes(attributeType);
if (attributes.size() == 1) {
@@ -302,23 +302,23 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public <T> void setSoleAttributeValue(AttributeTypeToken attributeType, T value) {
+ public <T> void setSoleAttributeValue(AttributeTypeToken<T> attributeType, T value) {
Attribute<T> attribute = getOrCreateSoleAttribute(attributeType);
attribute.setValue(value);
}
@Override
- public void setSoleAttributeFromString(AttributeTypeToken attributeType, String value) {
+ public void setSoleAttributeFromString(AttributeTypeToken<?> attributeType, String value) {
getOrCreateSoleAttribute(attributeType).setFromString(value);
}
@Override
- public void setSoleAttributeFromStream(AttributeTypeToken attributeType, InputStream inputStream) {
+ public void setSoleAttributeFromStream(AttributeTypeToken<?> attributeType, InputStream inputStream) {
getOrCreateSoleAttribute(attributeType).setValueFromInputStream(inputStream);
}
@Override
- public void setAttributesFromStrings(AttributeTypeToken attributeType, String... values) {
+ public void setAttributesFromStrings(AttributeTypeToken<?> attributeType, String... values) {
setAttributesFromStrings(attributeType, Arrays.asList(values));
}
@@ -327,7 +327,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
* the createAttributeFromString() method.
*/
@Override
- public <T> void setAttributesFromStrings(AttributeTypeToken attributeType, Collection<String> values) {
+ public <T> void setAttributesFromStrings(AttributeTypeToken<T> attributeType, Collection<String> values) {
Set<String> uniqueItems = new LinkedHashSet<>(values);
List<Attribute<T>> remainingAttributes = getAttributes(attributeType);
List<String> remainingNewValues = new ArrayList<>(uniqueItems.size());
@@ -365,7 +365,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public <T> void setAttributesFromValues(AttributeTypeToken attributeType, Collection<T> values) {
+ public <T> void setAttributesFromValues(AttributeTypeToken<T> attributeType, Collection<T> values) {
Set<T> uniqueItems = new LinkedHashSet<>(values);
List<Attribute<T>> remainingAttributes = getAttributes(attributeType);
List<T> remainingNewValues = new ArrayList<>(uniqueItems.size());
@@ -453,7 +453,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public <T> Attribute<T> createAttribute(AttributeTypeGeneric<T> attributeType) {
+ public <T> Attribute<T> createAttribute(AttributeTypeToken<T> attributeType) {
checkTypeValid(attributeType);
checkMultiplicityCanAdd(attributeType);
Attribute<T> attr = attributeFactory.createAttributeWithDefaults(this, getOrcsData(), attributeType);
@@ -461,26 +461,26 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
@Override
- public <T> Attribute<T> createAttribute(AttributeTypeToken attributeType, T value) {
+ public <T> Attribute<T> createAttribute(AttributeTypeToken<T> attributeType, T value) {
Attribute<T> attribute = createAttribute(attributeType);
attribute.setValue(value);
return attribute;
}
- private <T> Attribute<T> createAttributeFromString(AttributeTypeToken attributeType, String value) {
+ private <T> Attribute<T> createAttributeFromString(AttributeTypeToken<T> attributeType, String value) {
Attribute<T> attribute = createAttribute(attributeType);
attribute.setFromString(value);
return attribute;
}
@Override
- public Iterator<Map.Entry<AttributeTypeToken, List<Attribute<?>>>> iterator() {
+ public Iterator<Map.Entry<AttributeTypeToken<?>, List<Attribute<?>>>> iterator() {
return attributes.iterator();
}
//////////////////////////////////////////////////////////////
- private <T> Attribute<T> getOrCreateSoleAttribute(AttributeTypeToken attributeType) {
+ private <T> Attribute<T> getOrCreateSoleAttribute(AttributeTypeToken<T> attributeType) {
List<Attribute<T>> filterAttributes = getAttributes(attributeType);
int count = filterAttributes.size();
if (count > 1) {
@@ -495,7 +495,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
* Exclude any hard deleted attributes, but include artifact deleted attributes
*/
@Override
- public <T> Attribute<T> getSoleAttribute(AttributeTypeToken attributeType) {
+ public <T> Attribute<T> getSoleAttribute(AttributeTypeToken<T> attributeType) {
return getSoleAttribute(attributeType, DeletionFlag.EXCLUDE_DELETED);
}
@@ -504,7 +504,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
* all hard deleted attributes, but include artifact deleted attributes
*/
@Override
- public <T> Attribute<T> getSoleAttribute(AttributeTypeToken attributeType, DeletionFlag flag) {
+ public <T> Attribute<T> getSoleAttribute(AttributeTypeToken<T> attributeType, DeletionFlag flag) {
Collection<Attribute<T>> filterAttributes = getAttributes(attributeType, flag);
int size = filterAttributes.size();
if (size == 1) {
@@ -518,7 +518,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
//////////////////////////////////////////////////////////////
- private <T> void checkTypeValid(AttributeTypeToken attributeType) {
+ private <T> void checkTypeValid(AttributeTypeToken<T> attributeType) {
if (CoreAttributeTypes.Name.notEqual(attributeType)) {
if (!isAttributeTypeValid(attributeType)) {
throw new OseeArgumentException("The attribute type [%s] is not valid for artifacts [%s]", attributeType,
@@ -527,11 +527,11 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
}
- private <T> void checkMultiplicityCanAdd(AttributeTypeToken attributeType) {
+ private <T> void checkMultiplicityCanAdd(AttributeTypeToken<T> attributeType) {
checkMultiplicity(attributeType, getAttributeCount(attributeType) + 1);
}
- private <T> void checkMultiplicityCanDelete(AttributeTypeToken attributeType) {
+ private <T> void checkMultiplicityCanDelete(AttributeTypeToken<T> attributeType) {
checkMultiplicity(attributeType, getAttributeCount(attributeType) - 1);
}
@@ -568,7 +568,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
private void meetMinimumAttributes() {
- for (AttributeTypeToken attributeType : getValidAttributeTypes()) {
+ for (AttributeTypeToken<?> attributeType : getValidAttributeTypes()) {
int missingCount = getRemainingAttributeCount(attributeType);
for (int i = 0; i < missingCount; i++) {
attributeFactory.createAttributeWithDefaults(this, getOrcsData(), attributeType);
@@ -576,7 +576,7 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
}
}
- private final <T> int getRemainingAttributeCount(AttributeTypeToken attributeType) {
+ private final <T> int getRemainingAttributeCount(AttributeTypeToken<T> attributeType) {
int minLimit = artifactData.getType().getMin(attributeType);
return minLimit - getAttributeCount(attributeType);
}
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 355a255d431..3ba1546ab30 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
@@ -114,12 +114,12 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public int getAttributeCount(AttributeTypeToken type) {
+ public int getAttributeCount(AttributeTypeToken<?> type) {
return getProxiedObject().getAttributeCount(type);
}
@Override
- public int getAttributeCount(AttributeTypeToken type, DeletionFlag deletionFlag) {
+ public int getAttributeCount(AttributeTypeToken<?> type, DeletionFlag deletionFlag) {
return getProxiedObject().getAttributeCount(type, deletionFlag);
}
@@ -129,42 +129,42 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public Collection<AttributeTypeToken> getValidAttributeTypes() {
+ public Collection<AttributeTypeToken<?>> getValidAttributeTypes() {
return getProxiedObject().getValidAttributeTypes();
}
@Override
- public Collection<AttributeTypeToken> getExistingAttributeTypes() {
+ public Collection<AttributeTypeToken<?>> getExistingAttributeTypes() {
return getProxiedObject().getExistingAttributeTypes();
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType) {
return getProxiedObject().getSoleAttributeValue(attributeType);
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType, DeletionFlag flag, T defaultValue) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, DeletionFlag flag, T defaultValue) {
return getProxiedObject().getSoleAttributeValue(attributeType, flag, defaultValue);
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType, T defaultValue) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, T defaultValue) {
return getProxiedObject().getSoleAttributeValue(attributeType, defaultValue);
}
@Override
- public String getSoleAttributeAsString(AttributeTypeToken attributeType) {
+ public String getSoleAttributeAsString(AttributeTypeToken<?> attributeType) {
return getProxiedObject().getSoleAttributeAsString(attributeType);
}
@Override
- public String getSoleAttributeAsString(AttributeTypeToken attributeType, String defaultValue) {
+ public String getSoleAttributeAsString(AttributeTypeToken<?> attributeType, String defaultValue) {
return getProxiedObject().getSoleAttributeAsString(attributeType, defaultValue);
}
@Override
- public Long getSoleAttributeId(AttributeTypeToken attributeType) {
+ public Long getSoleAttributeId(AttributeTypeToken<?> attributeType) {
return getProxiedObject().getSoleAttribute(attributeType).getId();
}
@@ -174,7 +174,7 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public <T> List<T> getAttributeValues(AttributeTypeToken attributeType) {
+ public <T> List<T> getAttributeValues(AttributeTypeToken<T> attributeType) {
return getProxiedObject().getAttributeValues(attributeType);
}
@@ -195,9 +195,8 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken attributeType) {
- List<Attribute<T>> attributes = getProxiedObject().getAttributes(attributeType);
- return getProxyManager().asExternalAttributes(getSession(), attributes);
+ public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken<T> attributeType) {
+ return getProxyManager().asExternalAttributes(getSession(), getProxiedObject().getAttributes(attributeType));
}
@Override
@@ -207,7 +206,7 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken attributeType, DeletionFlag deletionFlag) {
+ public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken<T> attributeType, DeletionFlag deletionFlag) {
List<Attribute<T>> attributes = getProxiedObject().getAttributes(attributeType, deletionFlag);
return getProxyManager().asExternalAttributes(getSession(), attributes);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
index 05e957ca08d..c944d112de7 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
@@ -200,12 +200,12 @@ public class TransactionBuilderImpl implements TransactionBuilder {
}
@Override
- public ArtifactToken copyArtifact(ArtifactReadable sourceArtifact, Collection<AttributeTypeToken> attributesToDuplicate) {
+ public ArtifactToken copyArtifact(ArtifactReadable sourceArtifact, Collection<AttributeTypeToken<?>> attributesToDuplicate) {
return copyArtifact(sourceArtifact.getBranch(), sourceArtifact, attributesToDuplicate);
}
@Override
- public ArtifactToken copyArtifact(BranchId fromBranch, ArtifactId artifactId, Collection<AttributeTypeToken> attributesToDuplicate) {
+ public ArtifactToken copyArtifact(BranchId fromBranch, ArtifactId artifactId, Collection<AttributeTypeToken<?>> attributesToDuplicate) {
return txManager.copyArtifact(txData, fromBranch, artifactId, attributesToDuplicate);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
index 82a37c498dd..44dea6c9d25 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
@@ -315,13 +315,13 @@ public class TxDataManager {
return copyArtifactHelper(txData, source, source.getExistingAttributeTypes());
}
- public ArtifactReadable copyArtifact(TxData txData, BranchId fromBranch, ArtifactId artifactId, Collection<AttributeTypeToken> attributesToDuplicate) {
+ public ArtifactReadable copyArtifact(TxData txData, BranchId fromBranch, ArtifactId artifactId, Collection<AttributeTypeToken<?>> attributesToDuplicate) {
checkChangesAllowed(txData);
Artifact source = getSourceArtifact(txData, fromBranch, artifactId);
return copyArtifactHelper(txData, source, attributesToDuplicate);
}
- private ArtifactReadable copyArtifactHelper(TxData txData, Artifact source, Collection<AttributeTypeToken> attributesToDuplicate) {
+ private ArtifactReadable copyArtifactHelper(TxData txData, Artifact source, Collection<AttributeTypeToken<?>> attributesToDuplicate) {
Artifact copy =
artifactFactory.copyArtifact(txData.getSession(), source, attributesToDuplicate, txData.getBranch());
return asExternalArtifact(txData, copy);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
index f116548ea4c..dc3c10e0a79 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
@@ -124,11 +124,11 @@ public final class OrcsPredicates {
});
}
- public static Predicate<Attribute<?>> attributeId(final AttributeId attributeId) {
- return new Predicate<Attribute<?>>() {
+ public static <T> Predicate<Attribute<T>> attributeId(final AttributeId attributeId) {
+ return new Predicate<Attribute<T>>() {
@Override
- public boolean apply(Attribute<?> input) {
+ public boolean apply(Attribute<T> input) {
return attributeId.equals(input);
}
};
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
index fe3737c7932..038d81feb9e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
@@ -23,7 +23,7 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
/**
* @author Roberto E. Escobar
*/
-public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl<AttributeTypeGeneric<T>> implements AttributeData<T> {
+public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl<AttributeTypeToken<T>> implements AttributeData<T> {
private ArtifactId artifactId = ArtifactId.SENTINEL;
private boolean useBackingData = false;
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/AttributeEndpointImpl.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/AttributeEndpointImpl.java
index 84530a42c40..8b943576db4 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/AttributeEndpointImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/AttributeEndpointImpl.java
@@ -111,9 +111,9 @@ public class AttributeEndpointImpl implements AttributeEndpoint {
if (mediaType.isEmpty() || mediaType.startsWith("text") || textOut) {
builder.entity(attribute.getDisplayableString());
} else {
- ResultSet<? extends AttributeReadable<Object>> results =
+ ResultSet<? extends AttributeReadable<String>> results =
exactlyOne.getAttributes(CoreAttributeTypes.Extension);
- AttributeReadable<Object> extension = results.getOneOrNull();
+ AttributeReadable<String> extension = results.getOneOrNull();
if (extension != null) {
fileExtension = extension.getDisplayableString();
}
@@ -159,22 +159,22 @@ public class AttributeEndpointImpl implements AttributeEndpoint {
}
ArtifactReadable exactlyOne = queryBuilder.getResults().getExactlyOne();
- List<AttributeReadable<Object>> attrs = new ArrayList<>();
- for (AttributeReadable<Object> attr : exactlyOne.getAttributes(attributeType)) {
+ List<AttributeReadable<?>> attrs = new ArrayList<>();
+ for (AttributeReadable<?> attr : exactlyOne.getAttributes(attributeType)) {
attrs.add(attr);
}
if (attrs.size() == 1) {
builder = Response.ok();
AttributeReadable<?> attribute = attrs.iterator().next();
- String mediaType = attribute.getAttributeType().getMediaType();
+ String mediaType = attributeType.getMediaType();
String fileExtension = attribute.getAttributeType().getFileExtension();
if (mediaType.isEmpty() || mediaType.startsWith("text")) {
builder.entity(attribute.getDisplayableString());
} else {
- ResultSet<? extends AttributeReadable<Object>> results =
+ ResultSet<? extends AttributeReadable<String>> results =
exactlyOne.getAttributes(CoreAttributeTypes.Extension);
- AttributeReadable<Object> extension = results.getOneOrNull();
+ AttributeReadable<String> extension = results.getOneOrNull();
if (extension != null) {
fileExtension = extension.getDisplayableString();
}
@@ -206,7 +206,7 @@ public class AttributeEndpointImpl implements AttributeEndpoint {
sb.append(AHTML.beginMultiColumnTable(95));
sb.append(AHTML.addRowMultiColumnTable(AHTML.bold("Valid Types")));
sb.append(AHTML.addRowMultiColumnTable(""));
- for (AttributeTypeToken attrType : exactlyOne.getValidAttributeTypes()) {
+ for (AttributeTypeToken<?> attrType : exactlyOne.getValidAttributeTypes()) {
sb.append(AHTML.addRowMultiColumnTable(AHTML.bold("Name:"), attrType.getName()));
sb.append(AHTML.addRowMultiColumnTable(AHTML.bold("AttributeTypeId:"),
AHTML.getHyperlink(String.format("/orcs/branch/%s/artifact/%s/attribute/type/%s", branch, artifactId,
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
index 300c2c657c6..6e02ba75850 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
@@ -97,8 +97,8 @@ public class HtmlWriter {
data.put("Branch Id", asLink(uri.toASCIIString(), branchId));
data.put("Branch Name", asLink(uri.toASCIIString(), branchName));
- Collection<AttributeTypeToken> types = artifact.getExistingAttributeTypes();
- for (AttributeTypeToken type : types) {
+ Collection<AttributeTypeToken<?>> types = artifact.getExistingAttributeTypes();
+ for (AttributeTypeToken<?> type : types) {
for (AttributeReadable<?> attr : artifact.getAttributes(type)) {
URI attrUri = uriInfo.getAbsolutePathBuilder().path("/attribute/{attributeId}").build(attr.getId());
String label = asLink(attrUri.getPath(), type.getName());
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/TypesEndpointImpl.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/TypesEndpointImpl.java
index cc9c3247b04..a0bdec481b6 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/TypesEndpointImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/TypesEndpointImpl.java
@@ -130,7 +130,7 @@ public class TypesEndpointImpl implements TypesEndpoint {
OrcsTypesSheet sheet = new OrcsTypesSheet();
sheet.setArtifactId(art.getId());
sheet.setName(art.getName());
- ResultSet<? extends AttributeReadable<Object>> attributes =
+ ResultSet<? extends AttributeReadable<String>> attributes =
art.getAttributes(CoreAttributeTypes.UriGeneralStringData);
if (!attributes.isEmpty()) {
sheet.setAttrId(attributes.iterator().next().getId());
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java
index 49fb8200a1e..86e730be687 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java
@@ -148,13 +148,17 @@ public class OrcsCollectorWriter {
AttributeTypeToken attrType = getAttributeType(orcsApi.tokenService(), owAttribute.getType());
if (artifact.getAttributeCount(attrType) <= 1 && owAttribute.getValues().size() <= 1) {
- String currValue = artifact.getSoleAttributeAsString(attrType, null);
+ Object value = artifact.getSoleAttributeValue(attrType, null);
+ String currValue = null;
+ if (value != null) {
+ currValue = value.toString();
+ }
String newValue = null;
if (owAttribute.getValues().size() == 1) {
Object object = owAttribute.getValues().iterator().next();
if (object != null) {
- newValue = owAttribute.getValues().iterator().next().toString();
+ newValue = object.toString();
}
}
@@ -195,10 +199,9 @@ public class OrcsCollectorWriter {
}
} else if (attrType.isDate()) {
try {
- Date currVal = artifact.getSoleAttributeValue(attrType, null);
Date newVal = getDate(newValue);
- if (currVal == null || currVal.compareTo(newVal) != 0) {
- logChange(artifact, attrType, DateUtil.getMMDDYYHHMM(currVal),
+ if (value == null || ((Date) value).compareTo(newVal) != 0) {
+ logChange(artifact, attrType, DateUtil.getMMDDYYHHMM((Date) value),
DateUtil.getMMDDYYHHMM(newVal));
TransactionBuilder tx = getTransaction();
tx.setSoleAttributeValue(artifact, attrType, newVal);
@@ -277,7 +280,7 @@ public class OrcsCollectorWriter {
return null;
}
- protected static AttributeTypeToken getAttributeType(OrcsTokenService tokenService, OwAttributeType attributeType) {
+ protected static AttributeTypeToken<?> getAttributeType(OrcsTokenService tokenService, OwAttributeType attributeType) {
AttributeTypeToken attributeTypeToken = AttributeTypeToken.SENTINEL;
if (attributeType != null && attributeType.isValid()) {
attributeTypeToken = tokenService.getAttributeTypeOrSentinel(attributeType.getId());
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 864e48bc12c..762542d2581 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
@@ -48,29 +48,29 @@ public interface ArtifactReadable extends ArtifactToken, HasTransaction, OrcsRea
TransactionId getLastModifiedTransaction();
- int getAttributeCount(AttributeTypeToken type);
+ int getAttributeCount(AttributeTypeToken<?> type);
- int getAttributeCount(AttributeTypeToken type, DeletionFlag deletionFlag);
+ int getAttributeCount(AttributeTypeToken<?> type, DeletionFlag deletionFlag);
- Collection<AttributeTypeToken> getValidAttributeTypes();
+ Collection<AttributeTypeToken<?>> getValidAttributeTypes();
- Collection<AttributeTypeToken> getExistingAttributeTypes();
+ Collection<AttributeTypeToken<?>> getExistingAttributeTypes();
- <T> T getSoleAttributeValue(AttributeTypeToken attributeType);
+ <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType);
- <T> T getSoleAttributeValue(AttributeTypeToken attributeType, DeletionFlag flag, T defaultValue);
+ <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, DeletionFlag flag, T defaultValue);
- <T> T getSoleAttributeValue(AttributeTypeToken attributeType, T defaultValue);
+ <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, T defaultValue);
- String getSoleAttributeAsString(AttributeTypeToken attributeType);
+ String getSoleAttributeAsString(AttributeTypeToken<?> attributeType);
- String getSoleAttributeAsString(AttributeTypeToken attributeType, String defaultValue);
+ String getSoleAttributeAsString(AttributeTypeToken<?> attributeType, String defaultValue);
- Long getSoleAttributeId(AttributeTypeToken attributeType);
+ Long getSoleAttributeId(AttributeTypeToken<?> attributeType);
Long getSoleAttributeId(AttributeTypeToken attributeType, Long defaultValue);
- <T> List<T> getAttributeValues(AttributeTypeToken attributeType);
+ <T> List<T> getAttributeValues(AttributeTypeToken<T> attributeType);
Iterable<Collection<? extends AttributeReadable<Object>>> getAttributeIterable();
@@ -85,13 +85,13 @@ public interface ArtifactReadable extends ArtifactToken, HasTransaction, OrcsRea
ResultSet<? extends AttributeReadable<Object>> getAttributes();
- <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken attributeType);
+ <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken<T> attributeType);
ResultSet<? extends AttributeReadable<Object>> getAttributes(DeletionFlag deletionFlag);
- public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken attributeType, DeletionFlag deletionFlag);
+ <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken<T> attributeType, DeletionFlag deletionFlag);
- default String getAttributeValuesAsString(AttributeTypeToken attributeType) {
+ default <T> String getAttributeValuesAsString(AttributeTypeToken<T> attributeType) {
return Collections.toString(", ", getAttributeValues(attributeType));
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadableImpl.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadableImpl.java
index 4c5b188b589..29a24ac9111 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadableImpl.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadableImpl.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
import org.eclipse.osee.framework.core.data.AttributeId;
-import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttribute;
@@ -106,33 +105,33 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
}
@Override
- public int getAttributeCount(AttributeTypeToken type) {
+ public int getAttributeCount(AttributeTypeToken<?> type) {
return attributes.sizeByKey(type);
}
@Override
- public int getAttributeCount(AttributeTypeToken type, DeletionFlag deletionFlag) {
+ public int getAttributeCount(AttributeTypeToken<?> type, DeletionFlag deletionFlag) {
throw new UnsupportedOperationException();
}
@Override
- public Collection<AttributeTypeToken> getValidAttributeTypes() {
+ public Collection<AttributeTypeToken<?>> getValidAttributeTypes() {
throw new UnsupportedOperationException();
}
@Override
- public Collection<AttributeTypeToken> getExistingAttributeTypes() {
+ public Collection<AttributeTypeToken<?>> getExistingAttributeTypes() {
return attributes.keySet();
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType) {
List<T> values = getAttributeValues(attributeType);
ensureSole(attributeType, values);
return values.iterator().next();
}
- private void ensureSole(AttributeTypeToken attributeType, Collection<?> values) {
+ private void ensureSole(AttributeTypeToken<?> attributeType, Collection<?> values) {
if (values == null || values.size() < 1) {
throw new AttributeDoesNotExist("Attribute of type [%s] could not be found on [%s]", attributeType,
getIdString());
@@ -148,12 +147,12 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType, DeletionFlag flag, T defaultValue) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, DeletionFlag flag, T defaultValue) {
throw new UnsupportedOperationException();
}
@Override
- public <T> T getSoleAttributeValue(AttributeTypeToken attributeType, T defaultValue) {
+ public <T> T getSoleAttributeValue(AttributeTypeToken<T> attributeType, T defaultValue) {
List<T> values = getAttributeValues(attributeType);
if (values == null) {
return defaultValue;
@@ -168,12 +167,12 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
}
@Override
- public String getSoleAttributeAsString(AttributeTypeToken attributeType) {
+ public String getSoleAttributeAsString(AttributeTypeToken<?> attributeType) {
return getSoleAttributeValue(attributeType).toString();
}
@Override
- public String getSoleAttributeAsString(AttributeTypeToken attributeType, String defaultValue) {
+ public String getSoleAttributeAsString(AttributeTypeToken<?> attributeType, String defaultValue) {
Object value = getSoleAttributeValue(attributeType, null);
if (value == null) {
return defaultValue;
@@ -182,7 +181,7 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
}
@Override
- public Long getSoleAttributeId(AttributeTypeToken attributeType) {
+ public Long getSoleAttributeId(AttributeTypeToken<?> attributeType) {
List<IAttribute<?>> list = attributes.getValues(attributeType);
ensureNotMoreThanOne(attributeType, list.size());
return list.iterator().next().getId();
@@ -200,7 +199,7 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
@SuppressWarnings("unchecked")
@Override
- public <T> List<T> getAttributeValues(AttributeTypeToken attributeType) {
+ public <T> List<T> getAttributeValues(AttributeTypeToken<T> attributeType) {
if (attributes.isEmpty()) {
throw new OseeStateException("attributes not loaded for artifact [%s]", getIdString());
}
@@ -212,6 +211,10 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
return (List<T>) values.stream().map(IAttribute::getValue).collect(Collectors.toList());
}
+ public void putAttributeValue(AttributeTypeToken<?> attributeType, Object value) {
+
+ }
+
@SuppressWarnings("unchecked")
@Override
public <T> List<T> getAttributeValues(AttributeTypeToken attributeType, DeletionFlag deletionFlag) {
@@ -226,7 +229,7 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
return (List<T>) values.stream().map(IAttribute::getValue).collect(Collectors.toList());
}
- public void putAttributeValue(AttributeTypeGeneric<?> attributeType, IAttribute<?> attribute) {
+ public void putAttributeValue(AttributeTypeToken<?> attributeType, IAttribute<?> attribute) {
attributes.put(attributeType, attribute);
}
@@ -250,7 +253,7 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
}
@Override
- public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken attributeType) {
+ public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken<T> attributeType) {
throw new UnsupportedOperationException();
}
@@ -260,7 +263,7 @@ public final class ArtifactReadableImpl extends BaseId implements ArtifactReadab
}
@Override
- public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken attributeType, DeletionFlag deletionFlag) {
+ public <T> ResultSet<? extends AttributeReadable<T>> getAttributes(AttributeTypeToken<T> attributeType, DeletionFlag deletionFlag) {
throw new UnsupportedOperationException();
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
index 769707a3866..aaf7af51d1c 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
@@ -96,11 +96,11 @@ public interface TransactionBuilder {
ArtifactToken copyArtifact(ArtifactReadable sourceArtifact);
- ArtifactToken copyArtifact(ArtifactReadable sourceArtifact, Collection<AttributeTypeToken> attributesToDuplicate);
+ ArtifactToken copyArtifact(ArtifactReadable sourceArtifact, Collection<AttributeTypeToken<?>> attributesToDuplicate);
ArtifactToken copyArtifact(BranchId fromBranch, ArtifactId sourceArtifact);
- ArtifactToken copyArtifact(BranchId fromBranch, ArtifactId sourceArtifact, Collection<AttributeTypeToken> attributesToDuplicate);
+ ArtifactToken copyArtifact(BranchId fromBranch, ArtifactId sourceArtifact, Collection<AttributeTypeToken<?>> attributesToDuplicate);
ArtifactToken introduceArtifact(BranchId fromBranch, ArtifactId sourceArtifact);

Back to the top