added getAPIKey() to Translator.java

This commit is contained in:
5gi 2022-11-15 10:19:10 -05:00
parent 732fc3882d
commit f47c69715c

View File

@ -55,6 +55,9 @@ instead of "new Translator(String authKey)". NOTE: This will work but just some
public void setAPIKey(String authKey) { public void setAPIKey(String authKey) {
request = new Request(authKey); request = new Request(authKey);
} }
public String getAPIKey() {
return request.authKey;
}
public String translate(Language langToTranslateTo, String sourceMessage) { public String translate(Language langToTranslateTo, String sourceMessage) {
String response = "Error processing request"; String response = "Error processing request";
try { try {
@ -73,7 +76,7 @@ instead of "new Translator(String authKey)". NOTE: This will work but just some
return message; return message;
} }
protected static class Request { protected static class Request {
private final String authKey; public final String authKey;
public Request(String authKey) { public Request(String authKey) {
this.authKey = authKey; this.authKey = authKey;
} }