50 lines
1.0 KiB
Markdown
50 lines
1.0 KiB
Markdown
|
# FlexLib
|
||
|
|
||
|
Java Wrapper for FlexPlex API
|
||
|
|
||
|
## Maven
|
||
|
|
||
|
```xml
|
||
|
<repository>
|
||
|
<id>jitpack.io</id>
|
||
|
<url>https://jitpack.io</url>
|
||
|
</repository>
|
||
|
|
||
|
<dependency>
|
||
|
<groupId>fi.jonttu.git.FlexPlex</groupId>
|
||
|
<artifactId>FlexLib</artifactId>
|
||
|
<version>Version</version>
|
||
|
</dependency>
|
||
|
```
|
||
|
|
||
|
### Dependencies
|
||
|
|
||
|
```xml
|
||
|
<dependency>
|
||
|
<groupId>com.neovisionaries</groupId>
|
||
|
<artifactId>nv-websocket-client</artifactId>
|
||
|
<version>2.14</version>
|
||
|
</dependency>
|
||
|
<dependency>
|
||
|
<groupId>com.google.code.gson</groupId>
|
||
|
<artifactId>gson</artifactId>
|
||
|
<version>2.8.9</version>
|
||
|
</dependency>
|
||
|
```
|
||
|
|
||
|
## Example
|
||
|
|
||
|
```java
|
||
|
// Instantiate FlexLib, this should be done only once and instance saved.
|
||
|
final FlexLib flexLib = new FlexLib("token", Logger.getGlobal());
|
||
|
|
||
|
// Get friends API if its available
|
||
|
final Optional<PlayerFriends> playerFriends = getPlayerFriends("a2a20f04-b722-4192-b184-8e41f1080ead");
|
||
|
if (playerFriends.isPresent()) {
|
||
|
final Set<UUID> friends = playerFriends.getFriends();
|
||
|
}
|
||
|
|
||
|
// Disables FlexLib
|
||
|
flexLib.disable();
|
||
|
```
|