io.github.robertograham:nadir

Apex Legends REST API client

License

License

GroupId

GroupId

io.github.robertograham
ArtifactId

ArtifactId

nadir
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

io.github.robertograham:nadir
Apex Legends REST API client
Project URL

Project URL

https://github.com/RobertoGraham/nadir
Source Code Management

Source Code Management

https://github.com/RobertoGraham/nadir

Download nadir

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.robertograham/nadir/ -->
<dependency>
    <groupId>io.github.robertograham</groupId>
    <artifactId>nadir</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.robertograham/nadir/
implementation 'io.github.robertograham:nadir:1.1.0'
// https://jarcasting.com/artifacts/io.github.robertograham/nadir/
implementation ("io.github.robertograham:nadir:1.1.0")
'io.github.robertograham:nadir:jar:1.1.0'
<dependency org="io.github.robertograham" name="nadir" rev="1.1.0">
  <artifact name="nadir" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.robertograham', module='nadir', version='1.1.0')
)
libraryDependencies += "io.github.robertograham" % "nadir" % "1.1.0"
[io.github.robertograham/nadir "1.1.0"]

Dependencies

compile (10)

Group / Artifact Type Version
org.apache.httpcomponents : httpclient jar 4.5.7
jakarta.json : jakarta.json-api jar 1.1.5
jakarta.json.bind : jakarta.json.bind-api jar 1.0.1
org.glassfish : jakarta.json jar 1.1.5
org.eclipse : yasson jar 1.0.3
jakarta.xml.bind : jakarta.xml.bind-api jar 2.3.2
org.glassfish.jaxb : jaxb-runtime jar 2.3.2
org.igniterealtime.smack : smack-java7 jar 4.3.1
org.igniterealtime.smack : smack-tcp jar 4.3.1
org.igniterealtime.smack : smack-extensions jar 4.3.1

Project Modules

There are no modules declared in this project.

Maven Central

nadir

Features

  • Get UID of authenticated account
  • Get UIDs of other accounts by their usernames
  • Lazily reestablishes authentication session
  • Can establish connection to Origin's XMPP server

Usage

Get UID of authenticated account

import io.github.robertograham.nadir.Account;
import io.github.robertograham.nadir.Nadir;

import java.io.IOException;

public final class Main {

    public static void main(final String[] args) {
        try (final var nadir = Nadir.newNadir("emailAddress", "password")) {
            nadir.accounts()
                .findOneBySessionToken()
                .map(Account::userId)
                .ifPresent(System.out::println);
        } catch (final IOException exception) {
            exception.printStackTrace();
        }
    }
}

Get UID of other account by its username

import io.github.robertograham.nadir.Account;
import io.github.robertograham.nadir.Nadir;

import java.io.IOException;

public final class Main {

    public static void main(final String[] args) {
        try (final var nadir = Nadir.newNadir("emailAddress", "password")) {
            final var usernameString = "DiegosaursTTV";
            nadir.accounts()
                .findAllBySearchTerms(usernameString)
                .flatMap((final var accountList) -> accountList.stream()
                    .filter((final var account) -> usernameString.equalsIgnoreCase(account.username()))
                    .findFirst()
                    .map(Account::userId))
                .ifPresent(System.out::println);
        } catch (final IOException exception) {
            exception.printStackTrace();
        }
    }
}

Establish connection to Origin's XMPP server

import io.github.robertograham.nadir.Nadir;
import org.jivesoftware.smack.AbstractXMPPConnection;

import java.io.IOException;

public final class Main {

    public static void main(final String[] args) {
        try (final var nadir = Nadir.newBuilder("emailAddress", "password")
            .establishXmppConnection(true)
            .debugXmppTraffic(true)
            .build()) {
            nadir.xmppConnection()
                .map(AbstractXMPPConnection::isAuthenticated)
                .ifPresent(System.out::println);
        } catch (final IOException exception) {
            exception.printStackTrace();
        }
    }
}

Versions

Version
1.1.0
1.0.2
1.0.1
1.0.0