Java LocalDate Calculate isLocalDateOrDateTimeType(Class type)

Here you can find the source of isLocalDateOrDateTimeType(Class type)

Description

Is the type local date or local date-time?

License

Apache License

Parameter

Parameter Description
type The class type to be judged. (NotNull)

Return

The determination, true or false.

Declaration

public static boolean isLocalDateOrDateTimeType(Class<?> type) 

Method Source Code

//package com.java2s;
/*/*from www.j  a v a  2 s.c  o m*/
 * Copyright 2014-2015 the original author or authors.
 *
 * 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.LocalDate;
import java.time.LocalDateTime;

public class Main {
    /**
     * Is the type local date or local date-time?
     * @param type The class type to be judged. (NotNull)
     * @return The determination, true or false.
     */
    public static boolean isLocalDateOrDateTimeType(Class<?> type) {
        return LocalDate.class.isAssignableFrom(type)
                || LocalDateTime.class.isAssignableFrom(type);
    }
}

Related

  1. isDayOfWeek(LocalDate d, DayOfWeek dow)
  2. isEqual(LocalDate date1, LocalDate date2)
  3. isInPeriod(LocalDate subject, LocalDate start, LocalDate end)
  4. isLess(@Nonnull final LocalDate aDate1, @Nonnull final LocalDate aDate2)
  5. isLocalDateAD(LocalDate date)
  6. isNotNullAndAfter(LocalDate localDate1, LocalDate localDate2)
  7. isOverlapping(LocalDate firstStartDate, LocalDate firstEndDate, LocalDate secondStartDate, LocalDate secondEndDate)
  8. isValid(LocalDate ld1, LocalDate ld2, ZoneId zid, Predicate test)
  9. isWeekend(LocalDate date)