class UserFlagUtil {

  public static int getFlagValue(String userFlagType, boolean flagEnabled) {
    int decimalValue = 0;
    //if phone is verified flag should be true then only return flagvalue
    if(userFlagType.equals(UserFlagEnum.PHONE_VERIFIED.getUserFlagType()) &&
            flagEnabled) {
      decimalValue = UserFlagEnum.PHONE_VERIFIED.getUserFlagValue();
    } else if (userFlagType.equals(UserFlagEnum.EMAIL_VERIFIED.getUserFlagType()) &&
            flagEnabled) {
      //if email is verified flag should be true then only return flagvalue
      decimalValue = UserFlagEnum.EMAIL_VERIFIED.getUserFlagValue();
    } else if (userFlagType.equals(UserFlagEnum.STATE_VALIDATED.getUserFlagType()) &&
            flagEnabled) {
      //if user is state-validated flag should be true then only return flagvalue
      decimalValue = UserFlagEnum.STATE_VALIDATED.getUserFlagValue();
    }
    return decimalValue;
  }

}