21 lines
643 B
Java
21 lines
643 B
Java
package de.financer.model;
|
|
|
|
import java.util.Arrays;
|
|
|
|
public enum AccountStatus {
|
|
/** Indicates that the account is open for bookings */
|
|
OPEN,
|
|
/** Indicates that the account is closed and bookings to it are forbidden */
|
|
CLOSED;
|
|
|
|
/**
|
|
* This method validates whether the given string represents a valid account status.
|
|
*
|
|
* @param status to check
|
|
* @return whether the given status represents a valid account status
|
|
*/
|
|
public static boolean isValidType(String status) {
|
|
return Arrays.stream(AccountStatus.values()).anyMatch((accountStatus) -> accountStatus.name().equals(status));
|
|
}
|
|
}
|