Skip to content

Commit

Permalink
chore(api): update since tags for virtual components
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Feb 16, 2024
1 parent fa0fdce commit b88b00b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions api/src/main/java/net/kyori/adventure/text/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
* @param contextType the context type
* @param renderer the renderer
* @return a virtual component
* @since 4.14.0
* @since 4.16.0
*/
@Contract(value = "_, _ -> new", pure = true)
static <C> @NotNull VirtualComponent virtual(final @NotNull Class<C> contextType, final @NotNull VirtualComponentRenderer<C> renderer) {
Expand All @@ -1287,7 +1287,7 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
* @param renderer the renderer
* @param style the style
* @return a virtual component
* @since 4.14.0
* @since 4.16.0
*/
@Contract(value = "_, _, _ -> new", pure = true)
static <C> @NotNull VirtualComponent virtual(final @NotNull Class<C> contextType, final @NotNull VirtualComponentRenderer<C> renderer, final @NotNull Style style) {
Expand All @@ -1304,7 +1304,7 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
* @param renderer the renderer
* @param style the style elements
* @return a virtual component
* @since 4.14.0
* @since 4.16.0
*/
@Contract(value = "_, _, _ -> new", pure = true)
static <C> @NotNull VirtualComponent virtual(final @NotNull Class<C> contextType, final @NotNull VirtualComponentRenderer<C> renderer, final @NotNull StyleBuilderApplicable... style) {
Expand All @@ -1321,7 +1321,7 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
* @param renderer the renderer
* @param style the style elements
* @return a virtual component
* @since 4.14.0
* @since 4.16.0
*/
@Contract(value = "_, _, _ -> new", pure = true)
static <C> @NotNull VirtualComponent virtual(final @NotNull Class<C> contextType, final @NotNull VirtualComponentRenderer<C> renderer, final @NotNull Iterable<StyleBuilderApplicable> style) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
*
* <p>This component type is transient, and not guaranteed to survive during any sort of transformations or serialization.</p>
*
* @since 4.14.0
* @since 4.16.0
*/
public interface VirtualComponent extends TextComponent {
/**
* Gets the renderer context type.
*
* @return the renderer context type
* @since 4.14.0
* @since 4.16.0
*/
@NotNull Class<?> contextType();

/**
* Gets the renderer.
*
* @return the renderer
* @since 4.14.0
* @since 4.16.0
*/
@NotNull VirtualComponentRenderer<?> renderer();
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
* A holder for a value.
*
* @param <C> the context type
* @since 4.14.0
* @since 4.16.0
*/
public interface VirtualComponentRenderer<C> {
/**
* Gets the value by rendering using {@code context}.
*
* @param context the context
* @return the rendered value
* @since 4.14.0
* @since 4.16.0
*/
@UnknownNullability ComponentLike apply(final @NotNull C context);

Expand All @@ -48,7 +48,7 @@ public interface VirtualComponentRenderer<C> {
* <p>By default, this will be an empty string.</p>
*
* @return the fallback string
* @since 4.14.0
* @since 4.16.0
*/
default @NotNull String fallbackString() {
return "";
Expand Down

0 comments on commit b88b00b

Please sign in to comment.