Package org.joda.time

Examples of org.joda.time.MonthDay


            protected void callWithoutResult() {
                final List<QuarterDetail> quartersDetails = eventAggregationManagementDao.getQuartersDetails();
                EventDateTimeUtils.validateQuarters(quartersDetails);
               
                eventAggregationManagementDao.setQuarterDetails(Arrays.<QuarterDetail>asList(
                        new QuarterDetailImpl(new MonthDay(5, 1), new MonthDay(8, 1), 0),
                        new QuarterDetailImpl(new MonthDay(8, 1), new MonthDay(11, 1), 1),
                        new QuarterDetailImpl(new MonthDay(11, 1), new MonthDay(2, 1), 2),
                        new QuarterDetailImpl(new MonthDay(2, 1), new MonthDay(5, 1), 3)
                    ));
            }
        });
    }
View Full Code Here


        return EventDateTimeUtils.createStandardQuarters();
    }

    protected List<QuarterDetail> createOffsetQuarters() {
        return ImmutableList.<QuarterDetail>of(
                new QuarterDetailImpl(new MonthDay(5, 1), new MonthDay(8, 1), 0),
                new QuarterDetailImpl(new MonthDay(8, 1), new MonthDay(11, 1), 1),
                new QuarterDetailImpl(new MonthDay(11, 1), new MonthDay(2, 1), 2),
                new QuarterDetailImpl(new MonthDay(2, 1), new MonthDay(5, 1), 3)
                );
    }
View Full Code Here

        }
       
        final List<QuarterDetail> sortedQuarters = new ArrayList<QuarterDetail>(quarters);
        Collections.sort(sortedQuarters);
       
        MonthDay previousEnd = sortedQuarters.get(3).getEnd();
        final Iterator<QuarterDetail> itr = sortedQuarters.iterator();
        for (int i = 0; i < 4; i++) {
            final QuarterDetail q = itr.next();
            if (i != q.getQuarterId()) {
                throw new IllegalArgumentException("Quarter " + i + " has an illegal id of " + q.getQuarterId());
View Full Code Here

    /**
     * Create a new set of quarter details in the standard 1/1-4/1, 4/1-7/1, 7/1-10/1, 10/1-1/1 arrangement
     */
    public static List<QuarterDetail> createStandardQuarters() {
        return ImmutableList.<QuarterDetail>of(
                new QuarterDetailImpl(new MonthDay(1, 1), new MonthDay(4, 1), 0),
                new QuarterDetailImpl(new MonthDay(4, 1), new MonthDay(7, 1), 1),
                new QuarterDetailImpl(new MonthDay(7, 1), new MonthDay(10, 1), 2),
                new QuarterDetailImpl(new MonthDay(10, 1), new MonthDay(1, 1), 3)
                );
    }
View Full Code Here

        return this.start;
    }
   
    @Override
    public DateMidnight getStartDateMidnight(ReadableInstant instant) {
        final MonthDay instantMonthDay = new MonthDay(instant);
       
        //If the quarter wraps a year boundary AND
        //   the instant MonthDay is before the start AND
        //   the end is after the instant MonthDay
        // then shift the start year back by one to deal with the year boundary
        if (this.end.isBefore(this.start) && instantMonthDay.isBefore(this.start) && this.end.isAfter(instantMonthDay)) {
            return this.start.toDateTime(new DateTime(instant).minusYears(1)).toDateMidnight();
        }
       
        return this.start.toDateTime(instant).toDateMidnight();
    }
View Full Code Here

        return this.start.toDateTime(instant).toDateMidnight();
    }

    @Override
    public DateMidnight getEndDateMidnight(ReadableInstant instant) {
        final MonthDay instantMonthDay = new MonthDay(instant);
       
        //If the quarter wraps a year boundary AND
        //   the end is NOT after the instant MonthDay AND
        //   the instant MonthDay is NOT before the start
        // then shift the end year forward by one to deal with the year boundary
        if (this.end.isBefore(this.start) && !this.end.isAfter(instantMonthDay) && !instantMonthDay.isBefore(this.start)) {
            return this.end.toDateTime(new DateTime(instant).plusYears(1)).toDateMidnight();
        }
       
        return this.end.toDateTime(instant).toDateMidnight();
    }
View Full Code Here

                    final Integer chargeCalculationType = this.fromApiJsonHelper.extractIntegerNamed(chargeCalculationTypeParamName,
                            savingsChargeElement, locale);
                    final LocalDate dueDate = this.fromApiJsonHelper.extractLocalDateNamed(dueAsOfDateParamName, savingsChargeElement,
                            dateFormat, locale);

                    final MonthDay feeOnMonthDay = this.fromApiJsonHelper.extractMonthDayNamed(feeOnMonthDayParamName,
                            savingsChargeElement, monthDayFormat, locale);
                    final Integer feeInterval = this.fromApiJsonHelper.extractIntegerNamed(feeIntervalParamName, savingsChargeElement,
                            locale);

                    if (id == null) {
View Full Code Here

            final LocalDate transactionDate = this.fromApiJsonHelper.extractLocalDateNamed(dueAsOfDateParamName, element);
            baseDataValidator.reset().parameter(dueAsOfDateParamName).value(transactionDate).notNull();
        }

        if (this.fromApiJsonHelper.parameterExists(feeOnMonthDayParamName, element)) {
            final MonthDay monthDay = this.fromApiJsonHelper.extractMonthDayNamed(feeOnMonthDayParamName, element);
            baseDataValidator.reset().parameter(feeOnMonthDayParamName).value(monthDay).notNull();
        }

        throwExceptionIfValidationWarningsExist(dataValidationErrors);
    }
View Full Code Here

        }

        if (this.fromApiJsonHelper.parameterExists(feeOnMonthDayParamName, element)) {
            final String monthDayFormat = this.fromApiJsonHelper.extractMonthDayFormatParameter(element.getAsJsonObject());
            final Locale locale = this.fromApiJsonHelper.extractLocaleParameter(element.getAsJsonObject());
            final MonthDay monthDay = this.fromApiJsonHelper.extractMonthDayNamed(feeOnMonthDayParamName, element.getAsJsonObject(),
                    monthDayFormat, locale);
            baseDataValidator.reset().parameter(feeOnMonthDayParamName).value(monthDay).notNull();
        }

        if (this.fromApiJsonHelper.parameterExists(feeIntervalParamName, element)) {
View Full Code Here

            final int chargeTime = rs.getInt("chargeTime");
            final EnumOptionData chargeTimeType = ChargeEnumerations.chargeTimeType(chargeTime);

            final LocalDate dueAsOfDate = JdbcSupport.getLocalDate(rs, "dueAsOfDate");
            final Integer feeInterval = JdbcSupport.getInteger(rs, "feeInterval");
            MonthDay feeOnMonthDay = null;
            final Integer feeOnMonth = JdbcSupport.getInteger(rs, "feeOnMonth");
            final Integer feeOnDay = JdbcSupport.getInteger(rs, "feeOnDay");
            if (feeOnDay != null && feeOnMonth != null) {
                feeOnMonthDay = new MonthDay(feeOnMonth, feeOnDay);
            }

            final int chargeCalculation = rs.getInt("chargeCalculation");
            final EnumOptionData chargeCalculationType = ChargeEnumerations.chargeCalculationType(chargeCalculation);
            final boolean penalty = rs.getBoolean("penalty");
View Full Code Here

TOP

Related Classes of org.joda.time.MonthDay

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.