Java LocalDate Calculate isLess(@Nonnull final LocalDate aDate1, @Nonnull final LocalDate aDate2)

Here you can find the source of isLess(@Nonnull final LocalDate aDate1, @Nonnull final LocalDate aDate2)

Description

is Less

License

Apache License

Declaration

public static boolean isLess(@Nonnull final LocalDate aDate1,
            @Nonnull final LocalDate aDate2) 

Method Source Code

//package com.java2s;
/**/* w  w  w  .  ja v  a2 s .c  o  m*/
 * Copyright (C) 2014-2017 Philip Helger (www.helger.com)
 * philip[at]helger[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

import java.time.ZonedDateTime;

import javax.annotation.Nonnull;

public class Main {
    public static boolean isLess(@Nonnull final Duration aDuration1,
            @Nonnull final Duration aDuration2) {
        return aDuration1.compareTo(aDuration2) < 0;
    }

    public static boolean isLess(@Nonnull final ZonedDateTime aDT1,
            @Nonnull final ZonedDateTime aDT2) {
        return aDT1.compareTo(aDT2) < 0;
    }

    public static boolean isLess(@Nonnull final LocalDate aDate1,
            @Nonnull final LocalDate aDate2) {
        return aDate1.compareTo(aDate2) < 0;
    }

    public static boolean isLess(@Nonnull final LocalTime aTime1,
            @Nonnull final LocalTime aTime2) {
        return aTime1.compareTo(aTime2) < 0;
    }

    public static boolean isLess(@Nonnull final LocalDateTime aDateTime1,
            @Nonnull final LocalDateTime aDateTime2) {
        return aDateTime1.compareTo(aDateTime2) < 0;
    }
}

Related

  1. isAnyLocalDate(Object obj)
  2. isBankHoliday(List bankHolidays, LocalDate date)
  3. isDayOfWeek(LocalDate d, DayOfWeek dow)
  4. isEqual(LocalDate date1, LocalDate date2)
  5. isInPeriod(LocalDate subject, LocalDate start, LocalDate end)
  6. isLocalDateAD(LocalDate date)
  7. isLocalDateOrDateTimeType(Class type)
  8. isNotNullAndAfter(LocalDate localDate1, LocalDate localDate2)
  9. isOverlapping(LocalDate firstStartDate, LocalDate firstEndDate, LocalDate secondStartDate, LocalDate secondEndDate)