Skip to main content
summaryrefslogtreecommitdiffstats
blob: 402b55bbe20c7c3a71eaed38c6058e750380b27b (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*******************************************************************************
 * Copyright (c) 2004, 2008 John Anvik 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:
 *     John Anvik - initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.internal.bugzilla.core.history;

import java.text.MessageFormat;

/**
 * @author John Anvik
 */
public enum StatusType {
	VERIFIED, RESOLVED, CLOSED, REOPENED, ASSIGNED, NEW, UNCONFIRMED, NEEDINFO, /* ANT? */
	WAITING, /* GCC */
	SUSPENDED, /* GCC */
	MODIFIED, /* Redhat */
	POST, /* Redhat */
	INVESTIGATE, /* Redhat */
	PASSES_QA, /* Redhat */
	PROD_READY, /* Redhat */
	RELEASE_PENDING, /* Redhat */
	ON_QA, /* Redhat */
	QA_READY, /* Redhat */
	FAILS_QA, /* Redhat */
	SPEC, /* Redhat */
	UNKNOWN;

	public static StatusType convert(String change) {
		if (change.equals("RESOLVED")) { //$NON-NLS-1$
			return RESOLVED;
		}
		if (change.equals("ASSIGNED")) { //$NON-NLS-1$
			return ASSIGNED;
		}
		if (change.equals("NEW")) { //$NON-NLS-1$
			return NEW;
		}
		if (change.equals("REOPENED")) { //$NON-NLS-1$
			return REOPENED;
		}
		if (change.equals("CLOSED")) { //$NON-NLS-1$
			return CLOSED;
		}
		if (change.equals("VERIFIED")) { //$NON-NLS-1$
			return VERIFIED;
		}
		if (change.equals("UNCONFIRMED")) { //$NON-NLS-1$
			return UNCONFIRMED;
		}
		if (change.startsWith("NEEDINFO")) { //$NON-NLS-1$
			return NEEDINFO;
		}
		if (change.equals("WAITING")) { //$NON-NLS-1$
			return WAITING;
		}
		if (change.equals("SUSPENDED")) { //$NON-NLS-1$
			return SUSPENDED;
		}
		if (change.equals("MODIFIED")) { //$NON-NLS-1$
			return MODIFIED;
		}
		if (change.equals("POST")) { //$NON-NLS-1$
			return POST;
		}
		if (change.equals("INVESTIGATE")) { //$NON-NLS-1$
			return INVESTIGATE;
		}
		if (change.equals("PASSES_QA")) { //$NON-NLS-1$
			return PASSES_QA;
		}
		if (change.equals("PROD_READY")) { //$NON-NLS-1$
			return PROD_READY;
		}
		if (change.equals("RELEASE_PENDING")) { //$NON-NLS-1$
			return RELEASE_PENDING;
		}
		if (change.equals("ON_QA")) { //$NON-NLS-1$
			return ON_QA;
		}
		if (change.equals("QA_READY")) { //$NON-NLS-1$
			return QA_READY;
		}
		if (change.equals("FAILS_QA")) { //$NON-NLS-1$
			return FAILS_QA;
		}
		if (change.equals("SPEC")) { //$NON-NLS-1$
			return SPEC;
		}
		if (change.equals("") == false) { //$NON-NLS-1$
			System.err.println(MessageFormat.format(Messages.StatusType_Unknown_status_type_X, change));
		}
		return UNKNOWN;
	}
}

Back to the top