This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
forked from mattmalec/KSoft4J
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84d3542
commit 215cd4d
Showing
10 changed files
with
93 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 16 additions & 10 deletions
26
src/main/java/net/explodingbush/ksoftapi/enums/Routes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package net.explodingbush.ksoftapi.enums; | ||
|
||
public enum Routes { | ||
REDDIT("https://api.ksoft.si/meme/"); | ||
|
||
private final String route; | ||
|
||
private Routes(String route){ | ||
this.route = route; | ||
} | ||
public String toString(){ | ||
return this.route; | ||
} | ||
|
||
BAN_ADD("https://api.ksoft.si/bans/add"), | ||
BAN_INFO("https://api.ksoft.si/bans/info?user="), | ||
BAN_LIST("https://api.ksoft.si/bans/list?per_page="), | ||
IMAGE("https://api.ksoft.si/images/random-image?tag=%s&nsfw=%s"), | ||
WIKIHOW("https://api.ksoft.si/images/random-wikihow?nsfw=%s"), | ||
REDDIT("https://api.ksoft.si/meme/"); | ||
|
||
private final String route; | ||
|
||
private Routes(String route){ | ||
this.route = route; | ||
} | ||
public String toString(){ | ||
return this.route; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/net/explodingbush/ksoftapi/utils/Checks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.explodingbush.ksoftapi.utils; | ||
|
||
public class Checks { | ||
|
||
public static void notNull(Object object, String name) { | ||
if(object == null) { | ||
throw new IllegalArgumentException(name + " cannot be null"); | ||
} | ||
} | ||
public static void positive(int num, String name) { | ||
if(num < 1) { | ||
throw new IllegalArgumentException(name + " cannot be smaller than 1"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters