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 eitherInputStream
orBufferedImage
.
-
-
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.BufferedImage
getAsBufferedImage()
Gets the generated image as aBufferedImage
ornull
if anIOException
is encountered.java.io.InputStream
getAsInputStream()
Gets the Generated Image as anInputStream
.int
getCode()
Always returns 200 as a GeneratedImage instance is only returned on a successful request.@Nullable java.lang.String
getMessage()
Always returnsnull
as 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:
getCode
in interfaceGenericAPIResponse
- Returns:
- 200.
-
getMessage
@Nullable public @Nullable java.lang.String getMessage()
Always returnsnull
as the returned content is an Image and not JSON.- Specified by:
getMessage
in 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 aBufferedImage
ornull
if anIOException
is encountered.- Returns:
- Possibly-null
BufferedImage
of the generated image.
-
-