Package me.memerator.api.builder
Class MemeBuilder
java.lang.Object
me.memerator.api.builder.MemeBuilder
public class MemeBuilder extends Object
-
Constructor Summary
Constructors Constructor Description MemeBuilder()Constructor -
Method Summary
Modifier and Type Method Description org.json.JSONObjectbuild()Build the JSON body.voidsetAge(Age newAge)Sets the max age of the meme.voidsetCaption(String newCaption)Sets the caption of the meme.voidsetImage(String base64string)Sets the image of the meme to be uploaded, must be a base64 string.voidsetRating(int newRating)Set the rating of the meme, when you upload it your rating will be automatically applied.voidsetUrl(String newUrl)Deprecated.
-
Constructor Details
-
MemeBuilder
public MemeBuilder()Constructor
-
-
Method Details
-
setUrl
Deprecated.Sets the URL for the meme if uploading via URL. This or setImage() are required.- Parameters:
newUrl- the URL of the meme
-
setImage
Sets the image of the meme to be uploaded, must be a base64 string. This or setUrl() are required.- Parameters:
base64string- the image in base64
-
setRating
Set the rating of the meme, when you upload it your rating will be automatically applied. Optional!- Parameters:
newRating- the rating to set- Throws:
IllegalArgumentException- if the rating is not valid (between 1 and 5)
-
setAge
Sets the max age of the meme. By default is TEEN.- Parameters:
newAge- the MaxAge to set.
-
setCaption
Sets the caption of the meme. Optional!- Parameters:
newCaption- the caption to set
-
build
Build the JSON body. Used for the submitMeme() function.- Returns:
- a Meme JSON object to be sent
- Throws:
IllegalStateException- if a URL or Image has yet to be provided
-