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.ObjectBuilder 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 instanceprovided.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomImage.BuilderaddImage(@NotNull Image image)Adds an additionalImage instanceto the image.CustomImage.BuilderaddText(@NotNull Text text)Adds aText instanceto the image.CustomImagebuild()Generates a newCustomImage instanceto use for the actual API calls.static CustomImage.BuildercreateBase(@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 instanceto 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 instanceto 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 instanceto 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 instanceto 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 instanceto 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 instanceto use for the actual API calls.- Returns:
- New CustomImage instance to use.
-
-