nl.pvanassen:ns-api

Parent pom for projects by Paul van Assen

Лицензия

Лицензия

Группа

Группа

nl.pvanassen
Идентификатор

Идентификатор

ns-api
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Parent pom for projects by Paul van Assen
Система контроля версий

Система контроля версий

https://github.com/pvanassen/ns-api

Скачать ns-api

Как подключить последнюю версию

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.squareup.okhttp3 : okhttp jar 3.8.0
org.projectlombok : lombok jar 1.16.16
org.slf4j : slf4j-api jar 1.7.25

test (2)

Идентификатор библиотеки Тип Версия
ch.qos.logback : logback-classic jar 1.1.7
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Build Status Coverage Status

NS API

An API for talking to the NS (Dutch railways) API interface written in Java. The NS is using a mix between Dutch and English terms in their API. This reflects back to the Java implementation. The preferred language is English but some Dutch terms show up. Javadoc is English. When Dutch terms are used a translation is provided

Usage

To use the NS api you need to register an account with the NS. You can apply for an account at NS API.

You will receive a username and password. To use the Java api, you initialize the NsApi object:

NsApi nsApi = new NsApi(username, password);

Next step is to create a request, eg a 'actuele vertrektijden' request to get the current departures:

ApiRequest<ActueleVertrekTijden> request = RequestBuilder.getActueleVertrektijden(stationName)

To do the actual request, you call getApiResponse with your request:

ActueleVertrekTijden vertrekTijden = nsApi.getApiResponse(request); 

A new immutable object ActueleVertrekTijden is created containing the result of the API call.

All classes are immutable and thread safe.

Maven

Version 1.0 of this api is available in the central maven repository:

<dependency>
  <groupId>nl.pvanassen</groupId>
  <artifactId>ns-api</artifactId>
  <version>1.1.0</version>
</dependency>

Code borrowing

For parsing the XML I made use of the code found in this article: http://blog.another-d-mention.ro/programming/the-simplest-way-to-parse-xml-in-java/

License

The code is licensed under the Apache License.

Версии библиотеки

Версия
1.1.1
1.1.0
1.0