src/main/java/seedu/address/logic/parser/StatsCommandParser.java
/**
     * Parses the given {@code String} of arguments in the context of the StatsCommand
     * and returns a StatsCommand object for execution.
     * @throws ParseException if the user input does not conform the expected format
     */
Parses the given  String of arguments in the context of the StatsCommand
and returns a StatsCommand object for execution.
@throws ParseException if the user input does not conform the expected format
Parses the given String of arguments in the context of the StatsCommand and returns a StatsCommand object for execution . @throws ParseException if the user input does not conform the expected format
public StatsCommand parse(String args) throws ParseException {
        ArgumentMultimap argMultimap =
                ArgumentTokenizer.tokenize(args, PREFIX_VIEW_STATS);
        if (!arePrefixesPresent(argMultimap, PREFIX_VIEW_STATS) || !argMultimap.getPreamble().isEmpty()) {
            throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, StatsCommand.MESSAGE_USAGE));
        }
        boolean showCalorie;
        boolean showWeight;
        boolean showCommander;
        if (argMultimap.getValue(PREFIX_VIEW_STATS).get().equals("calorie")) {
            showCalorie = true;
            showWeight = false;
            showCommander = false;
        } else if (argMultimap.getValue(PREFIX_VIEW_STATS).get().equals("weight")) {
            showCalorie = false;
            showWeight = true;
            showCommander = false;
        } else if (argMultimap.getValue(PREFIX_VIEW_STATS).get().equals("all")) {
            showCalorie = true;
            showWeight = true;
            showCommander = false;
        } else if (argMultimap.getValue(PREFIX_VIEW_STATS).get().equals("commander")) {
            showCalorie = false;
            showWeight = false;
            showCommander = true;
        } else {
            throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, StatsCommand.MESSAGE_USAGE));
        }
        return new StatsCommand(showCalorie, showWeight, showCommander);
    }
public StatsCommand parse ( String args ) throws ParseException { ArgumentMultimap argMultimap = ArgumentTokenizer . tokenize ( args , PREFIX_VIEW_STATS ) ; if ( ! arePrefixesPresent ( argMultimap , PREFIX_VIEW_STATS ) || ! argMultimap . getPreamble ( ) . isEmpty ( ) ) { throw new ParseException ( String . format ( MESSAGE_INVALID_COMMAND_FORMAT , StatsCommand . MESSAGE_USAGE ) ) ; } boolean showCalorie ; boolean showWeight ; boolean showCommander ; if ( argMultimap . getValue ( PREFIX_VIEW_STATS ) . get ( ) . equals ( "calorie" ) ) { showCalorie = true ; showWeight = false ; showCommander = false ; } else if ( argMultimap . getValue ( PREFIX_VIEW_STATS ) . get ( ) . equals ( "weight" ) ) { showCalorie = false ; showWeight = true ; showCommander = false ; } else if ( argMultimap . getValue ( PREFIX_VIEW_STATS ) . get ( ) . equals ( "all" ) ) { showCalorie = true ; showWeight = true ; showCommander = false ; } else if ( argMultimap . getValue ( PREFIX_VIEW_STATS ) . get ( ) . equals ( "commander" ) ) { showCalorie = false ; showWeight = false ; showCommander = true ; } else { throw new ParseException ( String . format ( MESSAGE_INVALID_COMMAND_FORMAT , StatsCommand . MESSAGE_USAGE ) ) ; } return new StatsCommand ( showCalorie , showWeight , showCommander ) ; }
Parses the given {@code String} of arguments in the context of the StatsCommand
 and returns a StatsCommand object for execution.
Parses the given { @code String } of arguments in the context of the StatsCommand and returns a StatsCommand object for execution .