Package ch.andre601.fluxpoint4j.request
Class GeneratedImage
- java.lang.Object
-
- ch.andre601.fluxpoint4j.request.GeneratedImage
-
- All Implemented Interfaces:
GenericAPIResponse
public class GeneratedImage extends java.lang.Object implements GenericAPIResponse
Class containing the generated Image from a successful request with eithergetCustomImage(CustomImage)orgetWelcomeImage(WelcomeImage)in theFluxpoint4J class. This class allows you to get the image as eitherInputStreamorBufferedImage.
-
-
Constructor Summary
Constructors Constructor Description GeneratedImage(java.io.InputStream inputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.awt.image.BufferedImagegetAsBufferedImage()Gets the generated image as aBufferedImageornullif anIOExceptionis encountered.java.io.InputStreamgetAsInputStream()Gets the Generated Image as anInputStream.intgetCode()Always returns 200 as a GeneratedImage instance is only returned on a successful request.@Nullable java.lang.StringgetMessage()Always returnsnullas the returned content is an Image and not JSON.
-
-
-
Method Detail
-
getCode
public int getCode()
Always returns 200 as a GeneratedImage instance is only returned on a successful request.- Specified by:
getCodein interfaceGenericAPIResponse- Returns:
- 200.
-
getMessage
@Nullable public @Nullable java.lang.String getMessage()
Always returnsnullas the returned content is an Image and not JSON.- Specified by:
getMessagein interfaceGenericAPIResponse- Returns:
null
-
getAsInputStream
public java.io.InputStream getAsInputStream()
Gets the Generated Image as anInputStream.- Returns:
- InputStream containing the image.
-
getAsBufferedImage
@Nullable public @Nullable java.awt.image.BufferedImage getAsBufferedImage()
Gets the generated image as aBufferedImageornullif anIOExceptionis encountered.- Returns:
- Possibly-null
BufferedImageof the generated image.
-
-