Class CreateMazeRequest.Builder

java.lang.Object
dev.despical.mazeengine.api.request.CreateMazeRequest.Builder
Enclosing class:
CreateMazeRequest

public static final class CreateMazeRequest.Builder extends Object
Assembles immutable creation requests using direct override values.

Each call updates this builder and returns it for chaining. A builder can be reused, but it is mutable and must not be shared between threads. Requests already built are independent of subsequent builder changes.

For example:

CreateMazeRequest request = CreateMazeRequest.builder("arena", origin, cells)
        .preset("default")
        .seed(742L)
        .roof(false)
        .build();
  • Method Details

    • preset

      public CreateMazeRequest.Builder preset(String value)
      Selects the configured preset used to resolve the request.

      The identifier is normalized and validated when build() is called. Its existence is checked when creation is submitted.

      Parameters:
      value - the configured preset identifier
      Returns:
      this builder using the supplied preset
    • seed

      public CreateMazeRequest.Builder seed(long value)
      Uses an explicit deterministic generation seed.

      Zero and negative seeds are valid. Omit this call to generate a seed when the request is submitted.

      Parameters:
      value - the seed to use for topology generation
      Returns:
      this builder with the explicit seed
    • geometry

      public CreateMazeRequest.Builder geometry(MazeGeometry value)
      Overrides all structural dimensions together.

      The geometry controls corridor width, wall thickness, and wall height. Server volume limits are still checked at submission.

      Parameters:
      value - the complete geometry override
      Returns:
      this builder with the supplied geometry
      Throws:
      NullPointerException - if value is null
    • complexity

      public CreateMazeRequest.Builder complexity(double value)
      Overrides complexity and derives the generation biases from it.

      The value must be finite and within 0..1 inclusive. Validation occurs when build() constructs the request.

      Parameters:
      value - the requested complexity in 0..1
      Returns:
      this builder with the supplied complexity
    • roof

      public CreateMazeRequest.Builder roof(boolean value)
      Overrides the preset's ceiling setting.

      Passing false explicitly disables the roof even if the preset enables it. Omitting this call inherits the preset setting.

      Parameters:
      value - whether the maze should have a ceiling
      Returns:
      this builder with the explicit ceiling setting
    • snapshot

      public CreateMazeRequest.Builder snapshot(boolean value)
      Overrides the preset's original terrain capture setting.

      Passing true requires WorldEdit or FAWE at submission. Passing false explicitly disables capture rather than inheriting the preset.

      Parameters:
      value - whether original terrain should be captured
      Returns:
      this builder with the explicit capture setting
    • placement

      Overrides the occupied-block preflight policy.

      The selected policy controls which existing blocks are accepted before world work starts. It does not change the finished maze structure.

      Parameters:
      value - the occupied-block handling policy
      Returns:
      this builder with the supplied policy
      Throws:
      NullPointerException - if value is null
    • build

      public CreateMazeRequest build()
      Constructs an independent immutable request from the current values.

      This validates the identifier, required fields, and optional complexity. World availability, permissions, presets, and configured server limits are checked when the request is submitted to the operation service.

      Returns:
      a new creation request containing the builder's current values
      Throws:
      NullPointerException - if the preset identifier is null
      IllegalArgumentException - if the preset identifier or complexity is invalid