Java Time Utilities

Classes to simplify writing easily-testable code that uses real-world time (delays, stopwatches, etc.)

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.pervasivecode
ArtifactId

ArtifactId

java-time-utils
Last Version

Last Version

0.9
Release Date

Release Date

Type

Type

jar
Description

Description

Java Time Utilities
Classes to simplify writing easily-testable code that uses real-world time (delays, stopwatches, etc.)
Project URL

Project URL

https://github.com/JamieFlournoy/java-time-utils
Source Code Management

Source Code Management

https://github.com/JamieFlournoy/java-time-utils

Download java-time-utils

How to add to project

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

Dependencies

runtime (1)

Group / Artifact Type Version
com.google.guava : guava jar 26.0-jre

Project Modules

There are no modules declared in this project.

Pervasive Code's Java Time Utilities

This library includes a few simple classes that simplify the creation of easily-testable code that needs to care about doing things in relation to wall-clock time.

In particular, if you are using dependency injection, you will want an interface to isolate your wall-clock-time-sensitive code from any sources of real time, so that your setup code can provide real instances that get real time values, while your test code provides fake, controllable time providers that let your tests run with no dependency on actual wall-clock time.

This library provides interfaces and implementations that are useful for this sort of approach.

(This is not a library for working with quantities of time, calendars, or for measuring the amount of time something takes.)

Overview of included classes

Javadocs are available on javadoc.io:

Javadocs

See the separate OVERVIEW.md file for a description of what interfaces and classes are included. (Overview content is taken from class Javadoc comments, so there's no need to read both.)

Including it in your project

Use groupId com.pervasivecode, name time-utils, version 0.11 in your build tool of choice.

Gradle Example

If you are using Gradle 4.x or 5.x, put this in your build.properties file:

// in your build.gradle's repositories {} block:
    mavenCentral();

// in your build.gradle's dependencies {} block:
    implementation 'com.pervasivecode:time-utils:0.11'

    // or, if you prefer the separated group/name/version syntax:
    implementation group: 'com.pervasivecode', name: 'time-utils', version: '0.11'

Contributing

See DEVELOPERS.md and GRADLE_INTRO.md if you want to build and hack on the code yourself.

Copyright and License

Copyright © 2018 Jamie Flournoy.

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.

Versions

Version
0.9