Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-05-06 02:34:20 +0000
committerAngel Avila2016-05-06 02:34:20 +0000
commitf411cdb73fc14907f82a14d56e825c283e91f95f (patch)
tree9857370ea441811f8c3c882af6a1bdcc84026b41 /plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core
parent4434b76542ed80f4c6c2195b9067a15d04ea6671 (diff)
downloadorg.eclipse.osee-f411cdb73fc14907f82a14d56e825c283e91f95f.tar.gz
org.eclipse.osee-f411cdb73fc14907f82a14d56e825c283e91f95f.tar.xz
org.eclipse.osee-f411cdb73fc14907f82a14d56e825c283e91f95f.zip
refactor: Remove BranchReadable
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core')
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/BranchProvider.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java18
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/SingleBranchProvider.java5
4 files changed, 15 insertions, 17 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/BranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/BranchProvider.java
index 2fad21e1a93..4e8eca1ce40 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/BranchProvider.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/BranchProvider.java
@@ -11,12 +11,12 @@
package org.eclipse.osee.orcs.core.internal.branch.provider;
import java.util.Collection;
-import org.eclipse.osee.framework.core.model.BranchReadable;
+import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
* @author John R. Misinco
*/
public interface BranchProvider {
- Collection<BranchReadable> getBranches() throws OseeCoreException;
+ Collection<Branch> getBranches() throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java
index bbd26a5ab3a..3d67e909b2b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.BranchReadable;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.BranchFilter;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -34,14 +33,14 @@ public final class DeletedBranchProvider implements BranchProvider {
}
@Override
- public Collection<BranchReadable> getBranches() throws OseeCoreException {
+ public Collection<Branch> getBranches() throws OseeCoreException {
Conditions.checkNotNull(branchCache, "branchCache");
BranchFilter branchFilter = new BranchFilter(BranchArchivedState.ARCHIVED);
branchFilter.setBranchStates(BranchState.DELETED);
branchFilter.setNegatedBranchTypes(BranchType.BASELINE);
List<Branch> branches = branchCache.getBranches(branchFilter);
- Collection<BranchReadable> branchesToReturn = new LinkedHashSet<>();
+ Collection<Branch> branchesToReturn = new LinkedHashSet<>();
branchesToReturn.addAll(branches);
for (Branch branch : branches) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java
index f8531892567..96dd336beb8 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java
@@ -14,7 +14,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Predicate;
-import org.eclipse.osee.framework.core.model.BranchReadable;
+import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -24,17 +24,17 @@ import org.eclipse.osee.framework.jdk.core.util.Conditions;
public class MultiBranchProvider implements BranchProvider {
private final boolean recursive;
- private final Set<BranchReadable> branches;
- private final Predicate<BranchReadable> filter;
+ private final Set<Branch> branches;
+ private final Predicate<Branch> filter;
- public MultiBranchProvider(boolean recursive, Set<BranchReadable> branches, Predicate<BranchReadable> filter) {
+ public MultiBranchProvider(boolean recursive, Set<Branch> branches, Predicate<Branch> filter) {
this.recursive = recursive;
this.branches = branches;
this.filter = filter;
}
- private Collection<BranchReadable> getChildBranches(BranchReadable branch) throws OseeCoreException {
- Set<BranchReadable> children = new HashSet<>();
+ private Collection<Branch> getChildBranches(Branch branch) throws OseeCoreException {
+ Set<Branch> children = new HashSet<>();
branch.getChildBranches(children, true, filter);
if (filter.test(branch)) {
@@ -44,12 +44,12 @@ public class MultiBranchProvider implements BranchProvider {
}
@Override
- public Collection<BranchReadable> getBranches() throws OseeCoreException {
+ public Collection<Branch> getBranches() throws OseeCoreException {
Conditions.checkNotNull(branches, "seeds");
- Set<BranchReadable> result = branches;
+ Set<Branch> result = branches;
if (recursive) {
result = new HashSet<>(branches);
- for (BranchReadable b : branches) {
+ for (Branch b : branches) {
result.addAll(getChildBranches(b));
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/SingleBranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/SingleBranchProvider.java
index 73d7ad9b852..2a256e03c1c 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/SingleBranchProvider.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/SingleBranchProvider.java
@@ -13,20 +13,19 @@ package org.eclipse.osee.orcs.core.internal.branch.provider;
import java.util.Collection;
import java.util.Collections;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.BranchReadable;
/**
* @author Ryan D. Brooks
*/
public class SingleBranchProvider implements BranchProvider {
- private final BranchReadable branch;
+ private final Branch branch;
public SingleBranchProvider(Branch branch) {
this.branch = branch;
}
@Override
- public Collection<BranchReadable> getBranches() {
+ public Collection<Branch> getBranches() {
return Collections.singleton(branch);
}
} \ No newline at end of file

Back to the top