Package com.facebook.presto.jdbc.internal.joda.time

Examples of com.facebook.presto.jdbc.internal.joda.time.LocalDate


                jp.nextToken(); // VALUE_NUMBER_INT
                int day = jp.getIntValue();
                if (jp.nextToken() != JsonToken.END_ARRAY) {
                    throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY, "after LocalDate ints");
                }
                return new LocalDate(year, month, day);
            }
            break;
        case VALUE_NUMBER_INT:
            return new LocalDate(jp.getLongValue());           
        case VALUE_STRING:
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            }
View Full Code Here


        case VALUE_STRING:
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            }
            LocalDate local = parser.parseLocalDate(str);
            if (local == null) {
                return null;
            }
            return local.toDateMidnight();
        }
        throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, Number or String");
    }
View Full Code Here

                    if (st.hasMoreTokens()) {
                        str = st.nextToken();
                        zoneChar = parseZoneChar(str.charAt(str.length() - 1));
                        if (str.equals("24:00")) {
                            LocalDate date = (day == -1 ?
                                    new LocalDate(2001, month, 1).plusMonths(1) :
                                    new LocalDate(2001, month, day).plusDays(1));
                            advance = (day != -1);
                            month = date.getMonthOfYear();
                            day = date.getDayOfMonth();
                            dayOfWeek = ((dayOfWeek - 1 + 1) % 7) + 1;
                        } else {
                            millis = parseTime(str);
                        }
                    }
View Full Code Here

        Instant cutoverInstant;
        if (gregorianCutover == null) {
            cutoverInstant = DEFAULT_CUTOVER;
        } else {
            cutoverInstant = gregorianCutover.toInstant();
            LocalDate cutoverDate = new LocalDate(cutoverInstant.getMillis(), GregorianChronology.getInstance(zone));
            if (cutoverDate.getYear() <= 0) {
                throw new IllegalArgumentException("Cutover too early. Must be on or after 0001-01-01.");
            }
        }

        GJCacheKey cacheKey = new GJCacheKey(zone, cutoverInstant, minDaysInFirstWeek);
View Full Code Here

                    if (st.hasMoreTokens()) {
                        str = st.nextToken();
                        zoneChar = parseZoneChar(str.charAt(str.length() - 1));
                        if (str.equals("24:00")) {
                            LocalDate date = (day == -1 ?
                                    new LocalDate(2001, month, 1).plusMonths(1) :
                                    new LocalDate(2001, month, day).plusDays(1));
                            advance = (day != -1);
                            month = date.getMonthOfYear();
                            day = date.getDayOfMonth();
                            dayOfWeek = ((dayOfWeek - 1 + 1) % 7) + 1;
                        } else {
                            millis = parseTime(str);
                        }
                    }
View Full Code Here

            jp.nextToken(); // VALUE_NUMBER_INT
            int day = jp.getIntValue();
            if (jp.nextToken() != JsonToken.END_ARRAY) {
                throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY, "after LocalDate ints");
            }
            return new LocalDate(year, month, day);
        }
        switch (jp.getCurrentToken()) {
        case VALUE_NUMBER_INT:
            return new LocalDate(jp.getLongValue());           
        case VALUE_STRING:
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            }
View Full Code Here

        case VALUE_STRING:
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            }
            LocalDate local = parser.parseLocalDate(str);
            if (local == null) {
                return null;
            }
            return local.toDateMidnight();
        default:
        }
        throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, Number or String");
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.jdbc.internal.joda.time.LocalDate

Copyright © 2018 www.massapicom. 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.