Class StructureArray.PatternBuilder<T>
java.lang.Object
com.github.darksoulq.abyssallib.common.util.StructureArray.PatternBuilder<T>
- Type Parameters:
T- The element type.
- Enclosing class:
StructureArray<T>
Fluent builder for mapping characters in a string pattern to objects.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs the StructureArray.Binds a character to an object.Defines the grid shape using strings.
-
Method Details
-
pattern
Defines the grid shape using strings. Each string is one row.- Parameters:
rows- The pattern strings.- Returns:
- This builder.
-
key
Binds a character to an object.- Parameters:
key- The character in the pattern.value- The object to place.- Returns:
- This builder.
-
build
Constructs the StructureArray.- Returns:
- The resulting structure.
- Throws:
IllegalStateException- If pattern is empty or rows have inconsistent lengths.
-