Class ProteusBuilder
java.lang.Object
io.github.kaktushose.proteus.ProteusBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
TheProteusBuilder.ConflictStrategy
to use if a duplicate path registration happens.static enum
TheProteusBuilder.DefaultMapper
s to register. -
Method Summary
Modifier and TypeMethodDescription@NotNull Proteus
build()
Builds theProteus
instance.@NotNull ProteusBuilder
cacheSize
(int cacheSize) The cache size to use for the underlying LRU-Cache used for caching conversion paths.@NotNull ProteusBuilder
conflictStrategy
(@NotNull ProteusBuilder.ConflictStrategy conflictStrategy) TheProteusBuilder.ConflictStrategy
to use if a duplicate path registration happens.@NotNull ProteusBuilder
defaultMappers
(ProteusBuilder.DefaultMapper... defaultMappers) The default mappers to register as described byProteusBuilder.DefaultMapper
.
-
Method Details
-
cacheSize
The cache size to use for the underlying LRU-Cache used for caching conversion paths. The default value is1000
.- Parameters:
cacheSize
- cache size to use for the underlying LRU-Cache- Returns:
- this instance for fluent interface
-
defaultMappers
@NotNull public @NotNull ProteusBuilder defaultMappers(ProteusBuilder.DefaultMapper... defaultMappers) The default mappers to register as described byProteusBuilder.DefaultMapper
. These default mappers are lossless and follow the widening and narrowing primitive conversion of the Java Language Specification.- Parameters:
defaultMappers
- theProteusBuilder.DefaultMapper
s to register- Returns:
- this instance for fluent interface
- See Also:
- Implementation Note:
- By default, all
ProteusBuilder.DefaultMapper
s will be registered. Can be disabled by calling this method with zero arguments.
-
conflictStrategy
@NotNull public @NotNull ProteusBuilder conflictStrategy(@NotNull @NotNull ProteusBuilder.ConflictStrategy conflictStrategy) TheProteusBuilder.ConflictStrategy
to use if a duplicate path registration happens. Although, eachType
can haven
neighbours, but each path can only exist once.- Parameters:
conflictStrategy
- theProteusBuilder.ConflictStrategy
to use- Returns:
- this instance for fluent interface
-
build
-