Time Intervals

datatypes for intervals of Java.time classes

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.thimmwork
Идентификатор

Идентификатор

time-intervals-parent
Последняя версия

Последняя версия

0.2.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

Time Intervals
datatypes for intervals of Java.time classes
Ссылка на сайт

Ссылка на сайт

https://github.com/thimmwork/time-intervals
Система контроля версий

Система контроля версий

https://github.com/thimmwork/time-intervals/tree/master

Скачать time-intervals-parent

Имя Файла Размер
time-intervals-parent-0.2.0.pom 6 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.thimmwork/time-intervals-parent/ -->
<dependency>
    <groupId>net.thimmwork</groupId>
    <artifactId>time-intervals-parent</artifactId>
    <version>0.2.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/net.thimmwork/time-intervals-parent/
implementation 'net.thimmwork:time-intervals-parent:0.2.0'
// https://jarcasting.com/artifacts/net.thimmwork/time-intervals-parent/
implementation ("net.thimmwork:time-intervals-parent:0.2.0")
'net.thimmwork:time-intervals-parent:pom:0.2.0'
<dependency org="net.thimmwork" name="time-intervals-parent" rev="0.2.0">
  <artifact name="time-intervals-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='net.thimmwork', module='time-intervals-parent', version='0.2.0')
)
libraryDependencies += "net.thimmwork" % "time-intervals-parent" % "0.2.0"
[net.thimmwork/time-intervals-parent "0.2.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • core
  • jackson

Time Intervals

This library provides data types for intervals of java.time classes.

Build Status

Conventions

LocalDateIntervals are closed, which means that the year 2018 is represented by a LocalDateInterval starting on 2018-01-01 and ending on 2018-12-31.

Instant and DateTimeIntervals are closed-open, which means that the year 2018 is represented by 2018-01-01T:00:00:00 to 2019-01-01T00:00:00 in the respective time zone.

There are constants for Infinity which are

  • 1970-01-01 - 4000-12-31 for LocalDate
  • 1970-01-01 00:00:00 UTC - 4000-12-31 00:00:00 UTC

respectively. This makes calculations and usage a lot easier, because unbound intervals are treated just like bound ones and fields are always non-null.

To ensure intervals from user input or external sources are within these bounds, use the normalize() function.

Serialization

As of now, serialization via Jackson is supported. Other means may follow in the near future. Feel free to leave a feature request.

Jackson

A module that provides JSON de/serialization via Jackson is provided by the artifact

    <dependency>
        <groupId>net.thimmwork</groupId>
        <artifactId>time-intervals-jackson</artifactId>
    </dependency>

Register it to your ObjectMapper instance like this:

    objectMapper.registerModule(TimeIntervalsJackson.MODULE)

Версии библиотеки

Версия
0.2.0
0.1.0