Skip to content

Konloch/Constants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Constants

Constants is a very small zero dependency Java library packed with constants.

How To Add As Library

Add it as a maven dependency or just download the latest release.

<dependency>
  <groupId>com.konloch</groupId>
  <artifactId>Constants</artifactId>
  <version>1.1.0</version>
</dependency>

Links

How To Use

There are four main constant categories, Milliseconds, Nanoseconds, Integer and Long.

This library leverages the fact that constant expressions in Java turn into static numbers rather than being numerically expressed.

So on a bytecode level when compiled, x = 5 * MS.HOUR turns into x = 18000000. This makes using the constants in this library extremely performant.

Milliseconds are under MS, Nanoseconds are under NS, Integer is under INT and Long is under LONG.