Package net.kyori.adventure.resource
Interface ResourcePackInfo.Builder
-
- All Superinterfaces:
AbstractBuilder<ResourcePackInfo>,ResourcePackInfoLike
- Enclosing interface:
- ResourcePackInfo
public static interface ResourcePackInfo.Builder extends AbstractBuilder<ResourcePackInfo>, ResourcePackInfoLike
A builder for resource pack requests.- Since:
- 4.15.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NotNull ResourcePackInfoasResourcePackInfo()Gets aResourcePackInforepresentation.@NotNull ResourcePackInfobuild()Builds.default @NotNull java.util.concurrent.CompletableFuture<ResourcePackInfo>computeHashAndBuild()Builds, computing a hash based on the provided URL.@NotNull java.util.concurrent.CompletableFuture<ResourcePackInfo>computeHashAndBuild(@NotNull java.util.concurrent.Executor executor)Builds, computing a hash based on the provided URL.@NotNull ResourcePackInfo.Builderhash(@NotNull java.lang.String hash)Sets the hash.@NotNull ResourcePackInfo.Builderid(@NotNull java.util.UUID id)Sets the id.@NotNull ResourcePackInfo.Builderuri(@NotNull java.net.URI uri)Sets the uri.
-
-
-
Method Detail
-
id
@Contract("_ -> this") @NotNull @NotNull ResourcePackInfo.Builder id(@NotNull @NotNull java.util.UUID id)Sets the id.- Parameters:
id- the id- Returns:
- this builder
- Since:
- 4.15.0
-
uri
@Contract("_ -> this") @NotNull @NotNull ResourcePackInfo.Builder uri(@NotNull @NotNull java.net.URI uri)Sets the uri.If no UUID has been provided, setting a URL will set the ID to one based on the URL.
This parameter is required.
- Parameters:
uri- the uri- Returns:
- this builder
- Since:
- 4.15.0
-
hash
@Contract("_ -> this") @NotNull @NotNull ResourcePackInfo.Builder hash(@NotNull @NotNull java.lang.String hash)Sets the hash.- Parameters:
hash- the hash- Returns:
- this builder
- Since:
- 4.15.0
-
build
@NotNull @NotNull ResourcePackInfo build()
Builds.- Specified by:
buildin interfaceAbstractBuilder<ResourcePackInfo>- Returns:
- a new resource pack request
- Since:
- 4.15.0
-
computeHashAndBuild
@NotNull default @NotNull java.util.concurrent.CompletableFuture<ResourcePackInfo> computeHashAndBuild()
Builds, computing a hash based on the provided URL.The hash computation will perform a network request asynchronously, exposing the completed info via the returned future.
- Returns:
- a future providing the new resource pack request
- Since:
- 4.15.0
-
computeHashAndBuild
@NotNull @NotNull java.util.concurrent.CompletableFuture<ResourcePackInfo> computeHashAndBuild(@NotNull @NotNull java.util.concurrent.Executor executor)
Builds, computing a hash based on the provided URL.The hash computation will perform a network request asynchronously, exposing the completed info via the returned future.
- Parameters:
executor- the executor to perform the hash computation on- Returns:
- a future providing the new resource pack request
- Since:
- 4.15.0
-
asResourcePackInfo
@NotNull default @NotNull ResourcePackInfo asResourcePackInfo()
Description copied from interface:ResourcePackInfoLikeGets aResourcePackInforepresentation.- Specified by:
asResourcePackInfoin interfaceResourcePackInfoLike- Returns:
- a component
-
-