Interface ResourceRepositoryBuilder<T>
- All Known Implementing Classes:
ResourceRepositoryBuilderImpl
@API(status=STABLE,
since="2.0.0-milestone.2.4")
public interface ResourceRepositoryBuilder<T>
Constructs a
ResourceRepository
, based on an initial set of resources.-
Method Summary
Modifier and TypeMethodDescriptionaddResource
(ResourceKey resource, long amount) Adds a resource in the backing and view list.addStickyResource
(ResourceKey resource) Adds a resource into the view list and/or marks it as sticky so it's not removed when completely removed from the backing list.build()
-
Method Details
-
addResource
Adds a resource in the backing and view list.- Parameters:
resource
- the resourceamount
- the amount- Returns:
- this builder
-
addStickyResource
Adds a resource into the view list and/or marks it as sticky so it's not removed when completely removed from the backing list.- Parameters:
resource
- the resource- Returns:
- this builder
-
build
ResourceRepository<T> build()- Returns:
- a
ResourceRepository
with the specified resources
-