blob: d19ca65ca0cc83112a2277dfb549e87f6d244969 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
}
}
|