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 Details

    • addResource

      ResourceRepositoryBuilder<T> addResource(ResourceKey resource, long amount)
      Adds a resource in the backing and view list.
      Parameters:
      resource - the resource
      amount - the amount
      Returns:
      this builder
    • addStickyResource

      ResourceRepositoryBuilder<T> 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.
      Parameters:
      resource - the resource
      Returns:
      this builder
    • build

      Returns:
      a ResourceRepository with the specified resources