igdb-wrapper-java

Wrapper for IGDB REST-API

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.github.blackrose01
ArtifactId

ArtifactId

igdb-wrapper-java
Last Version

Last Version

v1.1
Release Date

Release Date

Type

Type

jar
Description

Description

igdb-wrapper-java
Wrapper for IGDB REST-API
Project URL

Project URL

https://github.com/BlackRose01/igdb-wrapper-java
Source Code Management

Source Code Management

https://github.com/BlackRose01/igdb-wrapper-java/tree/master

Download igdb-wrapper-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.blackrose01/igdb-wrapper-java/ -->
<dependency>
    <groupId>com.github.blackrose01</groupId>
    <artifactId>igdb-wrapper-java</artifactId>
    <version>v1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.blackrose01/igdb-wrapper-java/
implementation 'com.github.blackrose01:igdb-wrapper-java:v1.1'
// https://jarcasting.com/artifacts/com.github.blackrose01/igdb-wrapper-java/
implementation ("com.github.blackrose01:igdb-wrapper-java:v1.1")
'com.github.blackrose01:igdb-wrapper-java:jar:v1.1'
<dependency org="com.github.blackrose01" name="igdb-wrapper-java" rev="v1.1">
  <artifact name="igdb-wrapper-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.blackrose01', module='igdb-wrapper-java', version='v1.1')
)
libraryDependencies += "com.github.blackrose01" % "igdb-wrapper-java" % "v1.1"
[com.github.blackrose01/igdb-wrapper-java "v1.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar 2.3.2.RELEASE
com.google.code.gson : gson jar 2.8.6

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

IGDB Wrapper for Java

This wrapper should help you to send easily requests to the IGDB API.

Structure

Main package:

  • Wrapper class: send requests to API endpoints
  • Parameter class: manage possible parameters which will be accepted by API
  • Postfixes enum: hold relational operators for filter method in Parameters class
  • Version enum: hold versions of api

Endpoint package:

  • Endpoint interface to generalize different endpoint enumerations
  • EndpointPublic enum for public endpoints
  • EndpointPrivate enum for private

Model package:

  • all available models for endpoint

Example

Create an instance of the IgdbWrapper with API-Key, API-Url and create a Parameter object with your filter information. Finally, send the request to the API and save the response on the suitable model class.

// create instance of Wrapper
IgdbWrapper wrapper = new IgdbWrapper("<YOUR-API-KEY>", "<YOUR-API-URL>", Version.Standard);

// show all fields from games
// show full platform object list in games
// show full platform logo object in platform object
Parameters p = new Parameters()
        .addFields("*,platforms.*,platforms.platform_logo.*");

// send request to api and receive object
Game[] g = wrapper.sendRequest(EndpointPublic.Game, p, HttpMethod.POST, Game[].class);

// beautify JSON response
JsonParser parser = new JsonParser();
JsonObject json = parser.parse(g[0].toString()).getAsJsonObject();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = gson.toJson(json);
System.out.println(prettyJson);

License

The scripts and documentation in this project are released under the MIT License

Sources

Versions

Version
v1.1
v1.0
v0.12-alpha