package com.filestack.model.transform.tasks.faces;

import com.filestack.model.transform.base.ImageTransformTask;

public class PixelateFacesTask extends ImageTransformTask {

    // Constructor made private because this task cannot be used with default options
    private PixelateFacesTask() {
        super("pixelate_faces");
    }
    
    public static class Builder {
        private PixelateFacesTask pixelateFacesTask;
        
        public Builder() {
            this.pixelateFacesTask = new PixelateFacesTask();
        }

        public Builder faces(int... faces) {
            if (faces.length == 1) {
                pixelateFacesTask.addOption("faces", faces[0]);
                return this;
            }

            Integer[] objectArray = new Integer[faces.length];
            for (int i = 0; i < faces.length; i++)
                objectArray[i] = faces[i];
            pixelateFacesTask.addOption("faces", objectArray);
            return this;
        }

        // For "all" value
        public Builder faces(String faces) {
            pixelateFacesTask.addOption("faces", faces);
            return this;
        }

        public Builder minSize(int minSize) {
            pixelateFacesTask.addOption("minsize", minSize);
            return this;
        }

        public Builder minSize(double minSize) {
            pixelateFacesTask.addOption("minsize", minSize);
            return this;
        }

        public Builder maxSize(int maxSize) {
            pixelateFacesTask.addOption("maxsize", maxSize);
            return this;
        }

        public Builder maxSize(double maxSize) {
            pixelateFacesTask.addOption("maxsize", maxSize);
            return this;
        }

        public Builder buffer(int buffer) {
            pixelateFacesTask.addOption("buffer", buffer);
            return this;
        }

        public Builder amount(int amount) {
            pixelateFacesTask.addOption("amount", amount);
            return this;
        }

        public Builder blur(double blur) {
            pixelateFacesTask.addOption("blur", blur);
            return this;
        }

        public Builder type(String type) {
            pixelateFacesTask.addOption("type", type);
            return this;
        }

        public PixelateFacesTask build() {
            return pixelateFacesTask;
        }
    }
}

@@ -521,32 +521,251 @@
 k();%0A        %7D%0A%0A
+        /**%0A         * Sets which faces to pixelate.%0A         * Face numbers correspond to the order in which they appear in an image.%0A         *%0A         * @param faces one or more integers (faces) to blur%0A         */%0A
         public B
@@ -785,32 +785,32 @@
 int... faces) %7B%0A
-
             if (
@@ -1051,16 +1051,18 @@
 th; i++)
+ %7B
 %0A       
@@ -1097,16 +1097,30 @@
 ces%5Bi%5D;%0A
+            %7D%0A
         
@@ -1223,25 +1223,54 @@
    /
-/ For %22all%22 value
+** Allows setting %22all%22 for face selection. */
 %0A   

Fix linter warnings for PixelateFacesTask