Omnicron

Simple, fast, zero-dependency Cron expression evaluator for Java 8

License

License

Categories

Categories

Net
GroupId

GroupId

net.intelie.omnicron
ArtifactId

ArtifactId

omnicron
Last Version

Last Version

0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Omnicron
Simple, fast, zero-dependency Cron expression evaluator for Java 8
Source Code Management

Source Code Management

http://github.com/intelie/omnicron/tree/master

Download omnicron

How to add to project

<!-- https://jarcasting.com/artifacts/net.intelie.omnicron/omnicron/ -->
<dependency>
    <groupId>net.intelie.omnicron</groupId>
    <artifactId>omnicron</artifactId>
    <version>0.1</version>
</dependency>
// https://jarcasting.com/artifacts/net.intelie.omnicron/omnicron/
implementation 'net.intelie.omnicron:omnicron:0.1'
// https://jarcasting.com/artifacts/net.intelie.omnicron/omnicron/
implementation ("net.intelie.omnicron:omnicron:0.1")
'net.intelie.omnicron:omnicron:jar:0.1'
<dependency org="net.intelie.omnicron" name="omnicron" rev="0.1">
  <artifact name="omnicron" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.intelie.omnicron', module='omnicron', version='0.1')
)
libraryDependencies += "net.intelie.omnicron" % "omnicron" % "0.1"
[net.intelie.omnicron/omnicron "0.1"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.springframework : spring-context jar 4.3.0.RELEASE

Project Modules

There are no modules declared in this project.

Omnicron

Simple, fast, zero-dependency Cron expression evaluator for Java 8.

Features:

  • Check if a date matches against a Cron expression;
  • Compute next and previous execution dates of some Cron expression.

Design choices:

  • 0 0 * * * won't match DST gap
  • 0 23 * * * will match DST overlap twice

In other words, a cron expression will only match exactly what its values explicitly say.

Usage

Omnicron is available through Maven Central repository, just add the following dependency to your pom.xml file:

<dependency>
    <groupId>net.intelie.omnicron</groupId>
    <artifactId>omnicron</artifactId>
    <version>0.1</version>
</dependency>

Then, you can use it like that:

Cron cron = new Cron("*/5 * * * *");
ZonedDateTime date = ZonedDateTime.now();

System.out.println("Next execution: " + cron.next(date));
System.out.println("Prev execution: " + cron.prev(date));
net.intelie.omnicron

Intelie

Versions

Version
0.1