package com.github.javadev.undescriptive.protocol.request;

import java.util.LinkedHashMap;
import java.util.Map;

public class SolutionRequest implements HasParams {
    private final Integer scale;
    private final Integer claw;
    private final Integer wing;
    private final Integer fire;
    
    public SolutionRequest(
        final Integer scale,
        final Integer claw,
        final Integer wing,
        final Integer fire
            ) {
        this.scale = scale;
        this.claw = claw;
        this.wing = wing;
        this.fire = fire;
    }

    public Map<String, Object> getParams() {
        return new LinkedHashMap<String, Object>() { {
            put("dragon", new LinkedHashMap<String, Object>() { {
                put("scaleThickness", scale);
                put("clawSharpness", claw);
                put("wingStrength", wing);
                put("fireBreath", fire);
            } });
        } };
    }
    
    @Override
    public String toString() {
        return "SolutionRequest[" + scale + ", " + claw + ", " + wing + ", " + fire + "]";
    }

    public static Builder builder() {
        return new Builder();
    }

    public Integer getScale() {
        return scale;
    }

    public Integer getClaw() {
        return claw;
    }

    public Integer getWing() {
        return wing;
    }

    public Integer getFire() {
        return fire;
    }
    
    public static class Builder {
        private Integer scale;
        private Integer claw;
        private Integer wing;
        private Integer fire;

        private Builder() {
        }

        public Builder scale(final Integer scale) {
            this.scale = scale;
            return this;
        }
        
        public Builder claw(final Integer claw) {
            this.claw = claw;
            return this;
        }
        
        public Builder wing(final Integer wing) {
            this.wing = wing;
            return this;
        }
        
        public Builder fire(final Integer fire) {
            this.fire = fire;
            return this;
        }
        
        public SolutionRequest build() {
            return new SolutionRequest(scale, claw, wing, fire);
        }
    }
}

@@ -612,30 +612,52 @@
 ) %7B%0A        
-return
+Map%3CString, Object%3E params =
  new LinkedH
@@ -672,36 +672,33 @@
 tring, Object%3E()
- %7B %7B
+;
 %0A            put
@@ -694,25 +694,42 @@
     
-    put(%22dragon%22,
+Map%3CString, Object%3E dragonParams =
  new
@@ -764,29 +764,31 @@
 t%3E()
- %7B %7B%0A                
+;%0A        dragonParams.
 put(
@@ -817,32 +817,37 @@
 e);%0A        
-        
+dragonParams.
 put(%22clawSha
@@ -866,32 +866,37 @@
 w);%0A        
-        
+dragonParams.
 put(%22wingStr
@@ -918,24 +918,29 @@
         
-        
+dragonParams.
 put(%22fir
@@ -968,29 +968,65 @@
     
-    %7D %7D);%0A        %7D %7D
+params.put(%22dragon%22, dragonParams);%0A        return params
 ;%0A  

Fix codacity warnings.