no need for protected access modifier

This commit is contained in:
Kermina Awad 2020-06-09 23:23:42 -04:00
parent 4f41b7aa6e
commit b4a4519876
5 changed files with 12 additions and 12 deletions

View File

@ -23,7 +23,7 @@ class BitlyURLShortener extends URLShortener {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
protected String encodeData(String data) { String encodeData(String data) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("domain", "j.mp"); json.put("domain", "j.mp");
json.put("long_url", data); json.put("long_url", data);
@ -34,7 +34,7 @@ class BitlyURLShortener extends URLShortener {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
protected String encodeData(Map<String, String> data) { String encodeData(Map<String, String> data) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -21,14 +21,14 @@ public class GitHubPasteService extends PasteService {
} }
@Override @Override
public String encodeData(String data) { String encodeData(String data) {
Map<String, String> mapData = new HashMap<String, String>(); Map<String, String> mapData = new HashMap<String, String>();
mapData.put("multiverse.txt", data); mapData.put("multiverse.txt", data);
return this.encodeData(mapData); return this.encodeData(mapData);
} }
@Override @Override
public String encodeData(Map<String, String> files) { String encodeData(Map<String, String> files) {
JSONObject root = new JSONObject(); JSONObject root = new JSONObject();
root.put("description", "Multiverse-Core Debug Info"); root.put("description", "Multiverse-Core Debug Info");
root.put("public", !this.isPrivate); root.put("public", !this.isPrivate);

View File

@ -21,7 +21,7 @@ class HastebinPasteService extends PasteService {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public String encodeData(String data) { String encodeData(String data) {
return data; return data;
} }
@ -29,7 +29,7 @@ class HastebinPasteService extends PasteService {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public String encodeData(Map<String, String> data) { String encodeData(Map<String, String> data) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -23,7 +23,7 @@ public abstract class HttpAPIClient {
/** /**
* Types of data that can be sent. * Types of data that can be sent.
*/ */
protected enum ContentType { enum ContentType {
JSON, JSON,
PLAINTEXT, PLAINTEXT,
URLENCODED URLENCODED
@ -53,7 +53,7 @@ public abstract class HttpAPIClient {
* @param data The raw data to encode. * @param data The raw data to encode.
* @return A URL-encoded string. * @return A URL-encoded string.
*/ */
protected abstract String encodeData(String data); abstract String encodeData(String data);
/** /**
* Encode the given Map data into a format suitable for transmission in an HTTP request. * Encode the given Map data into a format suitable for transmission in an HTTP request.
@ -61,7 +61,7 @@ public abstract class HttpAPIClient {
* @param data The raw data to encode. * @param data The raw data to encode.
* @return A URL-encoded string. * @return A URL-encoded string.
*/ */
protected abstract String encodeData(Map<String, String> data); abstract String encodeData(Map<String, String> data);
/** /**
* Executes this API-Request. * Executes this API-Request.
@ -70,7 +70,7 @@ public abstract class HttpAPIClient {
* @return The result (as text). * @return The result (as text).
* @throws IOException When the I/O-operation failed. * @throws IOException When the I/O-operation failed.
*/ */
protected final String exec(String payload, ContentType type) throws IOException { final String exec(String payload, ContentType type) throws IOException {
BufferedReader rd = null; BufferedReader rd = null;
OutputStreamWriter wr = null; OutputStreamWriter wr = null;

View File

@ -21,7 +21,7 @@ class PastebinPasteService extends PasteService {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public String encodeData(String data) { String encodeData(String data) {
try { try {
return URLEncoder.encode("api_dev_key", "UTF-8") + "=" + URLEncoder.encode("d61d68d31e8e0392b59b50b277411c71", "UTF-8") + return URLEncoder.encode("api_dev_key", "UTF-8") + "=" + URLEncoder.encode("d61d68d31e8e0392b59b50b277411c71", "UTF-8") +
"&" + URLEncoder.encode("api_option", "UTF-8") + "=" + URLEncoder.encode("paste", "UTF-8") + "&" + URLEncoder.encode("api_option", "UTF-8") + "=" + URLEncoder.encode("paste", "UTF-8") +
@ -38,7 +38,7 @@ class PastebinPasteService extends PasteService {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public String encodeData(Map<String, String> data) { String encodeData(Map<String, String> data) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }