TavernerPOS - Source Code

Clone: 

git clone http://www.librarysmith.co.uk/tavernerPOS

 

package com.floreantpos.model;

import org.apache.commons.lang.StringUtils;

public enum PaymentStatusFilter {
	OPEN, PAID, CLOSED;

	public static PaymentStatusFilter fromString(String s) {
		if (StringUtils.isEmpty(s)) {
			return OPEN;
		}

		try {
			PaymentStatusFilter filter = valueOf(s);
			return filter;
		} catch (Exception e) {
			return OPEN;
		}
	}

	public String toString() {
		return name().replaceAll("_", " "); //$NON-NLS-1$ //$NON-NLS-2$
	}
}

Add comment
These comments are moderated so so won't be published until reviewed.