Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemedyConfig.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemedyConfig.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemedyConfig.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemedyConfig.java
new file mode 100644
index 000000000..d19ca65ca
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemedyConfig.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Red Hat, Inc. and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.operations;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+//TODO Javadoc
+public class RemedyConfig {
+
+ public boolean allowInstalledUpdate = false;
+ public boolean allowInstalledRemoval = false;
+ public boolean allowDifferentVersion = false;
+ public boolean allowPartialInstall = false;
+
+ public RemedyConfig() {
+
+ }
+
+ public static RemedyConfig[] getAllRemdyConfigs() {
+ Collection<RemedyConfig> remedyConfigs = new ArrayList<RemedyConfig>();
+ int allMasks = (1 << 4);
+ for (int i = 1; i < allMasks; i++) {
+ RemedyConfig remedyConfig = new RemedyConfig();
+ for (int j = 0; j < 4; j++) {
+ if ((i & (1 << j)) > 0) {
+ switch (j) {
+ case 0 :
+ remedyConfig.allowPartialInstall = true;
+ break;
+ case 1 :
+ remedyConfig.allowDifferentVersion = true;
+ break;
+ case 2 :
+ remedyConfig.allowInstalledUpdate = true;
+ break;
+ case 3 :
+ remedyConfig.allowInstalledRemoval = true;
+ break;
+ }
+ }
+
+ }
+ remedyConfigs.add(remedyConfig);
+ }
+ RemedyConfig[] test = remedyConfigs.toArray(new RemedyConfig[remedyConfigs.size()]);
+ return test;
+ }
+}

Back to the top