Class SimpleKeyedFocusModel.Builder<K>
java.lang.Object
io.github.cottonmc.cotton.gui.widget.focus.SimpleKeyedFocusModel.Builder<K>
- Type Parameters:
K
- the focus key type
- Enclosing class:
SimpleKeyedFocusModel<K>
A builder for
SimpleKeyedFocusModel
.
New instances can be obtained using SimpleKeyedFocusModel.builder()
.
This builder class is reusable – created instances are not affected by data added to this builder afterwards.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a focus to this builder.Adds a focus to this builder.addAll
(Collection<Focus<K>> foci) Adds foci from a collection to this builder.build()
Builds a newSimpleKeyedFocusModel
from the data in this builder.
-
Method Details
-
add
Adds a focus to this builder.- Parameters:
focus
- the focus to add- Returns:
- this builder
-
add
@Contract("_, null -> fail; _, _ -> this") public SimpleKeyedFocusModel.Builder<K> add(K key, Rect2i area) Adds a focus to this builder.- Parameters:
key
- the focus keyarea
- the focus area- Returns:
- this builder
-
addAll
@Contract("null -> fail; _ -> this") public SimpleKeyedFocusModel.Builder<K> addAll(Collection<Focus<K>> foci) Adds foci from a collection to this builder.- Parameters:
foci
- the foci to add- Returns:
- this builder
-
build
Builds a newSimpleKeyedFocusModel
from the data in this builder.- Returns:
- the created model
-