pit/libpit/src/com/jdbernard/pit/Category.groovy
Jonathan Bernard f3f30237b2 Reorganizing into subprojects.
libpit      - Personal Issue Tracker core libraries (Filter, Issue, Project, Category)
pit-cli     - Command Line Interface (CLI) to libpit
pit-swing   - Graphical, Swing interface to libpit (built using Griffon)

libpit and pit-swing both build, though pit-swing is just an empty griffon poject.
2010-02-13 11:58:00 -06:00

15 lines
330 B
Groovy

package com.jdbernard.pit
public enum Category {
BUG,
FEATURE,
TASK,
CLOSED
public static Category toCategory(String s) {
for(c in Category.values())
if (c.toString().startsWith(s.toUpperCase())) return c
throw new IllegalArgumentException("No category matches ${s}.")
}
}