Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbroberts2021-01-21 20:37:45 +0000
committerBaily Roberts2021-01-27 18:00:38 +0000
commit41aa64c66a68d27b4ad6b4c2e6ebcfb2f9c6925c (patch)
tree7e2de1c6277adc3fc45bf730827dd80bc47d385b
parentd8edf191f54616fd331b85f3c61c77f527e5273a (diff)
downloadorg.eclipse.osee-41aa64c66a68d27b4ad6b4c2e6ebcfb2f9c6925c.tar.gz
org.eclipse.osee-41aa64c66a68d27b4ad6b4c2e6ebcfb2f9c6925c.tar.xz
org.eclipse.osee-41aa64c66a68d27b4ad6b4c2e6ebcfb2f9c6925c.zip
feature[TW18520]: Add additional types to OrcsParamConverterProvider
Change-Id: I7c957b4b7b36e4650999aa20eede77cd595bdf75 Signed-off-by: broberts <baily.e.roberts@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java4
-rw-r--r--plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/OrcsParamConverterProvider.java50
3 files changed, 53 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java
index d65bf050d9c..f6113803f30 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java
@@ -91,8 +91,8 @@ public class BranchState extends NamedIdBase {
return this == BranchState.PURGE_IN_PROGRESS;
}
- public static BranchState valueOf(int id) {
- return NamedIdBase.valueOf(Long.valueOf(id), values);
+ public static BranchState valueOf(long id) {
+ return NamedIdBase.valueOf(id, values);
}
public static BranchState valueOf(String id) {
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java
index b64427f95e3..57243f60bab 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java
@@ -50,8 +50,8 @@ public class BranchType extends NamedIdBase {
return this == BranchType.PORT;
}
- public static BranchType valueOf(int id) {
- return NamedIdBase.valueOf(Long.valueOf(id), values);
+ public static BranchType valueOf(long id) {
+ return NamedIdBase.valueOf(id, values);
}
public static BranchType valueOf(String id) {
diff --git a/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/OrcsParamConverterProvider.java b/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/OrcsParamConverterProvider.java
index 4e56b0d79b8..d159c38b066 100644
--- a/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/OrcsParamConverterProvider.java
+++ b/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/OrcsParamConverterProvider.java
@@ -18,13 +18,21 @@ import java.lang.reflect.Type;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.Provider;
import org.eclipse.osee.framework.core.OrcsTokenService;
+import org.eclipse.osee.framework.core.data.ActivityTypeId;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactTypeJoin;
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.AttributeTypeJoin;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeJoin;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
+import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.UserId;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.jdk.core.type.Id;
/**
@@ -35,6 +43,15 @@ public final class OrcsParamConverterProvider implements javax.ws.rs.ext.ParamCo
private final ParamConverter<ArtifactTypeToken> artifactTypeConverter;
private final ParamConverter<AttributeTypeGeneric<?>> attributeTypeConverter;
private final ParamConverter<RelationTypeToken> relationTypeConverter;
+ private final ParamConverter<ArtifactId> artifactIdConverter;
+ private final ParamConverter<UserId> userIdConverter;
+ private final ParamConverter<BranchId> branchIdConverter;
+ private final ParamConverter<TransactionId> transactionIdConverter;
+ private final ParamConverter<AttributeId> attributeIdConverter;
+ private final ParamConverter<ActivityTypeId> activityTypeIdConverter;
+
+ private final ParamConverter<BranchState> branchStateConverter;
+ private final ParamConverter<BranchType> branchTypeConverter;
private final ParamConverter<ArtifactTypeJoin> artifactTypeJoinConverter;
private final ParamConverter<AttributeTypeJoin> attributeTypeJoinConverter;
@@ -60,6 +77,14 @@ public final class OrcsParamConverterProvider implements javax.ws.rs.ext.ParamCo
attributeTypeJoinConverter = new IdParamConverter<>(tokenService::getAttributeTypeJoin);
relationTypeJoinConverter = new IdParamConverter<>(tokenService::getRelationTypeJoin);
}
+ userIdConverter = new IdParamConverter<>(UserId::valueOf);
+ branchIdConverter = new IdParamConverter<>(BranchId::valueOf);
+ artifactIdConverter = new IdParamConverter<>(ArtifactId::valueOf);
+ transactionIdConverter = new IdParamConverter<>(TransactionId::valueOf);
+ activityTypeIdConverter = new IdParamConverter<>(ActivityTypeId::valueOf);
+ branchStateConverter = new IdParamConverter<>(BranchState::valueOf);
+ branchTypeConverter = new IdParamConverter<>(BranchType::valueOf);
+ attributeIdConverter = new IdParamConverter<>(AttributeId::valueOf);
}
@SuppressWarnings("unchecked")
@@ -84,7 +109,30 @@ public final class OrcsParamConverterProvider implements javax.ws.rs.ext.ParamCo
if (RelationTypeJoin.class.isAssignableFrom(rawType)) {
return (ParamConverter<T>) relationTypeJoinConverter;
}
-
+ if (ActivityTypeId.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) activityTypeIdConverter;
+ }
+ if (UserId.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) userIdConverter;
+ }
+ if (BranchId.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) branchIdConverter;
+ }
+ if (ArtifactId.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) artifactIdConverter;
+ }
+ if (TransactionId.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) transactionIdConverter;
+ }
+ if (AttributeId.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) attributeIdConverter;
+ }
+ if (BranchState.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) branchStateConverter;
+ }
+ if (BranchType.class.isAssignableFrom(rawType)) {
+ return (ParamConverter<T>) branchTypeConverter;
+ }
if (Id.class.isAssignableFrom(rawType)) {
return (ParamConverter<T>) idConverter;
}

Back to the top