Class AbstractMediaPayloadBuilder<T extends AbstractMediaPayloadBuilder<T>>
java.lang.Object
net.ygbstudio.powerwp4j.base.extension.builders.AbstractMediaPayloadBuilder<T>
- Type Parameters:
T- the concrete media payload builder subtype
- Direct Known Subclasses:
WPMediaPayloadBuilder
public abstract class AbstractMediaPayloadBuilder<T extends AbstractMediaPayloadBuilder<T>>
extends Object
Abstract builder for media attachment payloads.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an empty media payload builder base. -
Method Summary
Modifier and TypeMethodDescriptionSets the alternative text for the media attachment.abstract tools.jackson.databind.JsonNodebuild()Builds the media attachment payload as a JsonNode.Sets the caption for the media attachment.final Tclear()Resets all fields of the builder to their initial state.description(String description) Sets the description for the media attachment.protected Tself()Returns the current instance of the payload builder.
-
Field Details
-
altText
Alternative text for the media attachment. -
caption
Caption for the media attachment. -
description
Description for the media attachment.
-
-
Constructor Details
-
AbstractMediaPayloadBuilder
protected AbstractMediaPayloadBuilder()Creates an empty media payload builder base.
-
-
Method Details
-
self
Returns the current instance of the payload builder. This is a protected method used for chaining method calls.The cast to type T is safe because the method is only called within the class hierarchy and this class is parameterized with the type of the subclass.
- Returns:
- the current instance of the payload builder
-
altText
Sets the alternative text for the media attachment.- Parameters:
altText- Alternative text of the media attachment.- Returns:
- The current instance of AbstractMediaPayloadBuilder.
-
caption
Sets the caption for the media attachment.- Parameters:
caption- Caption of the media attachment.- Returns:
- The current instance of AbstractMediaPayloadBuilder.
-
description
Sets the description for the media attachment.- Parameters:
description- Description of the media attachment.- Returns:
- The current instance of AbstractMediaPayloadBuilder.
-
clear
Resets all fields of the builder to their initial state. This method is marked as final to ensure consistent behavior across all subclasses.- Returns:
- the current builder instance for method chaining
- See Also:
-
build
public abstract tools.jackson.databind.JsonNode build()Builds the media attachment payload as a JsonNode.- Returns:
- JsonNode representing the media attachment payload.
-