Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Contargo/contargo-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contargo Types

Build Status

This is a library aimed at providing a collection of re-usable Contargo objects.

Getting started

Using the contargo-types as a library in your project, means simply including it as a Maven dependency. We recommend using the Jitpack repository:

<dependency>
    <!-- From Jitpack-repo -->
    <groupId>com.github.Contargo</groupId>
    <artifactId>contargo-types</artifactId>
    <version>${SOME-TAG}</version>
</dependency>

Usage

Container

Container number

ContainerNumber containerNumber = ContainerNumber.forValue(string);

The built container number instance provides various information, such as the validity on isValid() or the formatted value on toString().

Validation
 public class Container {

    @ContainerNumber
    public String containerNumber;
    ...
 }

Bean validation for container numbers via @ContainerNumber based on the ISO6346

Provide validation.unit.number.error.message in your message.properties to set the validators error message.

Container type

ContainerType.FORTY_HC

The ContainerType enum provides the known container types.

Loading state

LoadingState.EMPTY
LoadingState.FULL

The LoadingState enum provides the possible container loading states.

Truck

License plate

LicensePlate licensePlate = LicensePlate.forValue(string).withCountry(LicensePlateCountry.GERMANY);

The built license plate instance provides various information depending on the bound country, such as the validity on isValid() or the formatted value on toString().

To find out which countries are supported, take a look at the LicensePlateCountry enum.

Transport

Direction

Direction.TURN_IN
Direction.TURN_OUT

The Direction enum describes the direction of a unit movement regarding one location.

Phone numbers

PhoneNumber phoneNumber = new PhoneNumber(string);

The built phone number instance provides various information about the phone number, such as the country code or country calling code or the regional phone number.

Format

The phone number instance can return the phone number in a international phone number formate.

Development

This is a pretty straight-forward Java-project, use mvn to build, test and deploy.

Release

The project use the Jitpack to be build. Steps before you can create an release:

  1. update the CHANGE.md
  2. update the project version in pom.xml to the version which should be released
  3. check the README.md if it is still correct else make an update

If the steps are done an release can be done by a Contargo-User on GitHub (release -> draft a new release)

License

This project is distributed under the Apache 2.0 License. The full set of terms and conditions can be seen in the LICENSE file.

Happy hacking!