Tempus Unit Conversion

Provide API's for unit conversion

License

License

GroupId

GroupId

com.hashmapinc.tempus
ArtifactId

ArtifactId

tempus-unit-conversion
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

Tempus Unit Conversion
Provide API's for unit conversion
Project URL

Project URL

http://hashmapinc.com

Download tempus-unit-conversion

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.poi : poi jar 4.0.1
org.apache.poi : poi-ooxml jar 4.0.1
org.projectlombok : lombok jar 1.18.4

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.3.2
org.junit.jupiter : junit-jupiter-engine jar 5.3.2
org.junit.jupiter : junit-jupiter-params jar 5.3.2

Project Modules

There are no modules declared in this project.

Hashmap, Inc Tempus

License

tempus-unit-conversion

Unit conversion library written for Tempus. Library uses Energistics Unit of Measure Usage Guide and standards for unit conversion. All unit conversion are supported according to Energistics conversion formula. Library provide api for converting given quantity to SI Unit system. Unit Conversion library also provide api's for quantity in given unit to target unit. API's for listing quantity classes and its different member units are supported in library.

Table of Contents

Features

This library aims to provide a few key features:

  • Converting given Quantity with unit to SI Unit
  • Converting given Quantity with unit to any other target unit in same Quantity Class
  • Listing all Quantity unit classes
  • Listing all Member Units for a particular Quantity Class

Requirements

  • JDK 1.8 at a minimum
  • Maven 3.1 or newer
  • Git client (to build locally)

Getting Started

To build the library and get started first off clone the GitHub repository

git clone https://github.com/hashmapinc/tempus-unit-conversion.git

Change directory into the tempus-unit-conversion

cd tempus-unit-conversion

Execute a maven clean install

mvn clean install

A Build success message should appear

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.308 s
[INFO] Finished at: 2018-12-13T11:35:54+05:30
[INFO] Final Memory: 32M/479M
[INFO] ------------------------------------------------------------------------

Usage

Initalization

    UnitConvertorService unitConvertorService = UnitConvertorContext.getInstanceOfUnitConvertorService();
    QuantityClassSetService quantityClassSetService = UnitConvertorContext.getInstanceOfQuantityClassSetService();

Unit Convertor API's

  • Convert kilometer(km) to meter(m) which is SI unit of length
    Quantity quantity = new Quantity(10.0, "km");
    Quantity siQuantity = unitConvertorService.convertToSiUnit(quantity);
  • Convert kilometer(km) to feet(m)
Quantity quantity = new Quantity(2.5, "km");
Quantity targetQuantity = unitConvertorService.convertToTargetUnit(quantity, "ft");
  • Get All Quantity Class
    Set quantitySetClasses = quantityClassSetService.getAllQuantityClass();
  • Get Member Units for length Quantiy Class
    Set lengths = quantityClassSetService.getMemberUnitsForQuantityClass("length");
  • Get all Member Units with all Quanaity Class
    Map quantityClassMap = quantityClassSetService.getMemberUnitsForAllQuantityClass();

License

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.

Maven

Can be used with the following maven dependancy

         <dependency>
            <groupId>com.hashmapinc.tempus</groupId>
            <artifactId>tempus-unit-conversion</artifactId>
            <version>1.0.4</version>
        </dependency>
com.hashmapinc.tempus

HASHMAP INC

Versions

Version
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0