Examples of NaturalDateParser


Examples of org.graylog2.utilities.date.NaturalDateParser

            throw new WebApplicationException(Response.Status.BAD_REQUEST);
        }

        Map<String, String> result = null;
        try {
            result = new NaturalDateParser().parse(string).asMap();
        } catch (NaturalDateParser.DateNotParsableException e) {
            LOG.debug("Could not parse from natural date: " + string);
            throw new WebApplicationException(422);
        }
View Full Code Here

Examples of org.graylog2.utilities.date.NaturalDateParser

    public KeywordRange(String keyword) throws InvalidRangeParametersException {
        if (keyword == null || keyword.isEmpty()) {
            throw new InvalidRangeParametersException();
        }
        try {
            NaturalDateParser.Result result = new NaturalDateParser().parse(keyword);
            from = result.getFrom();
            to = result.getTo();
        } catch (NaturalDateParser.DateNotParsableException e) {
            throw new InvalidRangeParametersException("Could not parse from natural date: " + keyword);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.