class SizeGreaterThan extends GenericMatcher {

    @Override
    public void init() throws MessagingException {
        String amount = getCondition();
        
        if (amount != null) {
            amount = amount.trim().toLowerCase(Locale.US);
        } else {
            throw new MessagingException("Please configure an amount");
        }
        try {
            if (amount.endsWith("k")) {
                amount = amount.substring(0, amount.length() - 1);
                cutoff = Integer.parseInt(amount) * 1024;
            } else if (amount.endsWith("m")) {
                amount = amount.substring(0, amount.length() - 1);
                cutoff = Integer.parseInt(amount) * 1024 * 1024;
            } else {
                cutoff = Integer.parseInt(amount);
            }
        } catch (NumberFormatException e) {
            throw new MessagingException("Invalid amount: " + amount);
        }
        if (cutoff < 1) {
            throw new MessagingException("Amount should be strictly superior to 0");
        }
    }

}