Skip to content

EasyAPI is a lightweight, general-purpose Java 21 library for everyday backend tasks. It includes async execution, logging, REST utilities, file/YAML IO, runtime metrics, versioning, a small console command framework, and Minecraft utilities.

License

Notifications You must be signed in to change notification settings

EinfacheSache/EasyAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyAPI

Java 21 Build with Maven License: Apache-2.0

🌍 Available Languages: English | Deutsch


EasyAPI

EasyAPI is a lightweight and general-purpose Java library.
It provides helpers for async execution, logging, REST HTTP calls, file/YAML utilities, runtime metrics, version utilities, a small console command framework, and Minecraft utilities (e.g., Mojang UUID lookup).

Project setup: Java 21, Maven, Apache-2.0 license
Maven coordinates: de.einfachesache:api:1.0


📦 Dependency

If you use JitPack, add this to your pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.EinfacheSache</groupId>
        <artifactId>EasyAPI</artifactId>
        <version>VERSION</version>
    </dependency>
</dependencies>

📋 Table of Contents


🚀 Features

  • AsyncExecutor — lightweight scheduler with safe() wrapper for error handling.
  • Logging — Logback/SLF4J bridge with custom converters.
  • REST utilities — OkHttp wrapper with GET/POST/DELETE helpers.
  • Files & YAML — read/write helpers.
  • Runtime metrics — monitor memory/CPU/runtime usage.
  • Version utils — compare versions and check updates.
  • Console commands — minimal framework to register commands.
  • Minecraft — Mojang UUID/name lookup utilities.

⚙ Requirements

  • Java 21+
  • Maven 3.9+

🔧 Installation

Option A: Build locally

mvn clean install

Then depend on de.cubeattack:api:1.0.

Option B: Use via JitPack

See the Dependency section above.


💻 Usage Examples

Async tasks

AsyncExecutor.getService().schedule(
    AsyncExecutor.safe(() -> {
        // async work here
    }),
    1, java.util.concurrent.TimeUnit.SECONDS
);

REST requests

RestAPIUtils http = new RestAPIUtils();
var res = http.request("GET", "https://example.com/api", null);
if (res != null && res.isSuccessful()) {
    System.out.println(res.body().string());
}

Minecraft UUID lookup

UUID id = MinecraftAPI.getUUID("Notch");
System.out.println(id);

📂 Modules / Packages

  • de.einfachesache.api — core utilities
  • de.einfachesache.api.console — console framework
  • de.einfachesache.api.logger — logging
  • de.einfachesache.api.minecraft — Minecraft utils
  • de.einfachesache.api.util — misc utils (files, runtime, REST, etc.)
  • de.einfachesache.api.util.version — version comparison

🏗 Build from Source

mvn clean package
# Output: target/EasyAPI-1.0-SNAPSHOT.jar

📦 Dependencies

Declared in pom.xml:

  • com.google.code.gson:gson
  • ch.qos.logback:logback-classic (scope: provided)
  • org.slf4j:slf4j-simple
  • org.bspfsystems:yamlconfiguration
  • com.squareup.okhttp3:okhttp (scope: provided)
  • commons-io:commons-io (scope: provided)

📜 License

Apache-2.0 — see LICENSE.md

About

EasyAPI is a lightweight, general-purpose Java 21 library for everyday backend tasks. It includes async execution, logging, REST utilities, file/YAML IO, runtime metrics, versioning, a small console command framework, and Minecraft utilities.

Resources

License

Security policy

Stars

Watchers

Forks

Languages