Class PageServiceBuilder
java.lang.Object
de.chojo.jdautil.pagination.PageServiceBuilder
- All Implemented Interfaces:
PageServiceModifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and registers the service at the providedShardManager.Sets the custom id of the next button.Sets the text of the next buttonpreviousId(String id) Sets the custom id of the previous button.previousText(String text) Sets the text of the previous buttonSets the cache used to cache registered pages.Modify a new cache builder which will be used to build the underlying cache to cache registered pages.withLocalizer(ILocalizer localizer) Defined the localizer to be used to localize thepreviousTextandnextText
-
Constructor Details
-
PageServiceBuilder
-
-
Method Details
-
previousId
Sets the custom id of the previous button.- Specified by:
previousIdin interfacePageServiceModifier- Parameters:
id- custom id- Returns:
- builder instance
-
nextId
Sets the custom id of the next button.- Specified by:
nextIdin interfacePageServiceModifier- Parameters:
id- custom id- Returns:
- builder instance
-
previousText
Sets the text of the previous button- Specified by:
previousTextin interfacePageServiceModifier- Parameters:
text- text- Returns:
- builder instance
-
nextText
Sets the text of the next button- Specified by:
nextTextin interfacePageServiceModifier- Parameters:
text- text- Returns:
- builder instance
-
withCache
Sets the cache used to cache registered pages.- Specified by:
withCachein interfacePageServiceModifier- Parameters:
cache- cache instance- Returns:
- builder instance
-
withCache
public PageServiceBuilder withCache(Consumer<com.google.common.cache.CacheBuilder<Object, Object>> cache) Modify a new cache builder which will be used to build the underlying cache to cache registered pages.- Specified by:
withCachein interfacePageServiceModifier- Parameters:
cache- cache builder instance- Returns:
- builder instance
-
withLocalizer
Defined the localizer to be used to localize thepreviousTextandnextText- Specified by:
withLocalizerin interfacePageServiceModifier- Parameters:
localizer- localizer instance- Returns:
- builder instance
-
build
Builds and registers the service at the providedShardManager.- Returns:
- a new page service instance
-