Package ch.andre601.fluxpoint4j.image
Class CustomImage.Builder
- java.lang.Object
-
- ch.andre601.fluxpoint4j.image.CustomImage.Builder
-
- Enclosing class:
- CustomImage
public static class CustomImage.Builder extends java.lang.Object
Builder class to create a newCustomImage instance
. To get a new Builder instance will you need to callcreateBase(Image)
with a validImage instance
.
Additional images may be added usingaddImage(Image)
and Text can be added usingaddText(Text)
with a validText instance
provided.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomImage.Builder
addImage(@NotNull Image image)
Adds an additionalImage instance
to the image.CustomImage.Builder
addText(@NotNull Text text)
Adds aText instance
to the image.CustomImage
build()
Generates a newCustomImage instance
to use for the actual API calls.static CustomImage.Builder
createBase(@NotNull Image base)
Creates a new instance of this Builder using the providedImage instance
.
-
-
-
Method Detail
-
createBase
public static CustomImage.Builder createBase(@NotNull @NotNull Image base)
Creates a new instance of this Builder using the providedImage instance
.
The provided Image instance will set a few things such as the final image's width and height.- Parameters:
base
- TheImage instance
to use as the base layer of the image.- Returns:
- New instance of this Builder class to use.
-
addImage
public CustomImage.Builder addImage(@NotNull @NotNull Image image)
Adds an additionalImage instance
to the image.
This image will be added as a new layer in the final image by the API.Calling this method again or
addText(Text)
can result in parts of the provided image being covered by the new Image or Text provided in those extra calls. This depends on if parts of the image and text overlap with each other.- Parameters:
image
- TheImage instance
to add as a new layer for the image.- Returns:
- The builder instance after the Image has been added. Useful for chaining.
-
addText
public CustomImage.Builder addText(@NotNull @NotNull Text text)
Adds aText instance
to the image.
This text will be added as a new layer in the final image by the API.Calling this method again or
addImage(Image)
can result in parts of the provided image being covered by the new Image or Text provided in those extra calls. This depends on if parts of the image and text overlap with each other.- Parameters:
text
- TheText instance
to add as a new layer for the image.- Returns:
- The builder instance after the Image has been added. Useful for chaining.
-
build
public CustomImage build()
Generates a newCustomImage instance
to use for the actual API calls.- Returns:
- New CustomImage instance to use.
-
-