class Delay {

    public static Delay from(String initString) throws MessagingException {
        if (Strings.isNullOrEmpty(initString)) {
            throw new NumberFormatException("Null or Empty strings are not permitted");
        }
        List<String> parts = Splitter.on('*').trimResults().splitToList(initString);

        if (parts.size() == 1) {
            return new Delay(DEFAULT_ATTEMPTS, DurationParser.parse(parts.get(0)));
        }
        if (parts.size() == 2) {
            int attempts = Integer.parseInt(parts.get(0));
            if (attempts < 0) {
                throw new MessagingException("Number of attempts negative in " + initString);
            }
            return new Delay(attempts, DurationParser.parse(parts.get(1)));
        }
        throw new MessagingException(initString + " contains too much parts");
    }

    public  Delay();
    @VisibleForTesting  Delay(int attempts, Duration delayTime);

}