Merged Classes

Fixed repetitive auth key usage
This commit is contained in:
5gi 2022-11-03 17:46:40 -04:00
parent 50d01058aa
commit 2c276acaf9

View File

@ -1,5 +1,16 @@
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// //
// //
// //
// //
// //
// //
// //
// //
// //
// DeepJ is a Java Wrapper for the DeepL Free Public API. This was originally made by Steven (Forked From) and Updated by 5gi //
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
package tech.nevets.deepj;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
@ -9,7 +20,6 @@ import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
public class Translator {
Request request;
public Translator(String authKey) {
@ -32,8 +42,7 @@ public class Translator {
}
return message;
}
private static class Request {
protected static class Request {
private final String authKey;
public Request(String authKey) {
this.authKey = authKey;
@ -90,4 +99,15 @@ public class Translator {
ZH
}
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// //
// //
// //
// //
// //
// //
// //
// //
// //
// DeepJ is a Java Wrapper for the DeepL Free Public API. This was originally made by Steven (Forked From) and Updated by 5gi //
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://