blob: e21b6745647fc9decf55a85cc343459e714fd473 (
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
|
/*******************************************************************************
* Copyright (c) 2015 SAP SE 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:
* SAP SE - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.p2.publisher.eclipse;
import org.eclipse.osgi.util.NLS;
enum FeatureInstallMode {
INCLUDE("include"), ROOT("root"); //$NON-NLS-1$ //$NON-NLS-2$
private final String attributeValue;
private FeatureInstallMode(String attributeValue) {
this.attributeValue = attributeValue;
}
public static FeatureInstallMode parse(String value) {
if (value == null) {
return INCLUDE;
}
for (FeatureInstallMode mode : FeatureInstallMode.values()) {
if (mode.attributeValue.equals(value))
return mode;
}
throw new IllegalArgumentException(NLS.bind(Messages.exception_invalidFeatureInstallMode, value));
}
}
|