Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-02-18 14:29:45 -0500
committerRyan D. Brooks2011-02-18 14:29:45 -0500
commit9670909cb814f918c24c53bbe6d7f1b4a09ca573 (patch)
tree05e5960784a5e0050ed50793058f0331f106320a /plugins/org.eclipse.osee.framework.core.message
parent612bc2128b40eff24709aced29b9d2bd2557953f (diff)
downloadorg.eclipse.osee-9670909cb814f918c24c53bbe6d7f1b4a09ca573.tar.gz
org.eclipse.osee-9670909cb814f918c24c53bbe6d7f1b4a09ca573.tar.xz
org.eclipse.osee-9670909cb814f918c24c53bbe6d7f1b4a09ca573.zip
refactor: Cleanup token creation and inheritance
Create static TokenFactory to handle token creation Create HasArtifactType interface Create HasBranch interface Fix ArtifactToken inheritance Remove token subclasses
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message')
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchRequest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java12
2 files changed, 6 insertions, 10 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchRequest.java
index 7fa12201b2..0361608979 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchRequest.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchRequest.java
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message;
+import org.eclipse.osee.framework.core.data.HasBranch;
import org.eclipse.osee.framework.core.data.IOseeBranch;
/**
* @author Roberto E. Escobar
*/
-public class SearchRequest {
+public class SearchRequest implements HasBranch {
private final IOseeBranch branch;
private final String rawSearch;
@@ -32,6 +33,7 @@ public class SearchRequest {
this.options = options != null ? options : new SearchOptions();
}
+ @Override
public IOseeBranch getBranch() {
return branch;
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
index 0562d9dab1..91b15736a8 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
@@ -14,7 +14,7 @@ import java.util.Collection;
import org.eclipse.osee.framework.core.data.BranchToken;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.data.NamedIdentity;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.message.SearchOptions;
import org.eclipse.osee.framework.core.message.SearchRequest;
@@ -43,7 +43,7 @@ public class SearchRequestTranslator implements ITranslator<SearchRequest> {
public SearchRequest convert(PropertyStore store) {
String guid = store.get(Entry.BRANCH_GUID.name());
String name = store.get(Entry.BRANCH_NAME.name());
- IOseeBranch branch = new BranchToken(guid, name);
+ IOseeBranch branch = TokenFactory.createBranch(guid, name);
String rawSearch = store.get(Entry.RAW_SEARCH.name());
SearchOptions options = new SearchOptions();
@@ -61,7 +61,7 @@ public class SearchRequestTranslator implements ITranslator<SearchRequest> {
for (int index = 0; index < typeFilterGuids.length; index++) {
guid = typeFilterGuids[index];
name = index < typeFilterNames.length ? typeFilterNames[index] : Strings.emptyString();
- IAttributeType type = new AttributeTypeFilter(guid, name);
+ IAttributeType type = TokenFactory.createAttributeType(guid, name);
options.addAttributeTypeFilter(type);
}
}
@@ -100,10 +100,4 @@ public class SearchRequestTranslator implements ITranslator<SearchRequest> {
}
return store;
}
-
- private static final class AttributeTypeFilter extends NamedIdentity implements IAttributeType {
- public AttributeTypeFilter(String guid, String name) {
- super(guid, name);
- }
- }
}

Back to the top