package io.github.luizgrp.sectionedrecyclerviewadapter;

/**
 * POJO which acts as constructor parameters of {@link Section Sections}.
 */
public class SectionParameters {
    public final Integer headerResourceId;
    public final Integer footerResourceId;
    public final int itemResourceId;
    public final Integer loadingResourceId;
    public final Integer failedResourceId;

    /**
     * Builder pattern mentioned by Joshua Bloch in Effective Java, 2nd Edition
     */
    public static class Builder {
        private final int itemResourceId;

        private Integer headerResourceId;
        private Integer footerResourceId;
        private Integer loadingResourceId;
        private Integer failedResourceId;

        /**
         * Create a Builder object to construct SectionParameters
         * @param itemResourceId layout resource for Section's items
         */
        public Builder(int itemResourceId) {
            this.itemResourceId = itemResourceId;
        }

        /**
         * Set layout resource for Section's header of this builder
         * @param headerResourceId layout resource for Section's header
         * @return this builder
         */
        public Builder headerResourceId(int headerResourceId) {
            this.headerResourceId = headerResourceId;

            return this;
        }

        /**
         * Set layout resource for Section's footer of this builder
         * @param footerResourceId layout resource for Section's footer
         * @return this builder
         */
        public Builder footerResourceId(int footerResourceId) {
            this.footerResourceId = footerResourceId;

            return this;
        }

        /**
         * Set layout resource for Section's loading state of this builder
         * @param loadingResourceId layout resource for Section's loading state
         * @return this builder
         */
        public Builder loadingResourceId(int loadingResourceId) {
            this.loadingResourceId = loadingResourceId;

            return this;
        }

        /**
         * Set layout resource for Section's failed state of this builder
         * @param failedResourceId layout resource for Section's failed state
         * @return this builder
         */
        public Builder failedResourceId(int failedResourceId) {
            this.failedResourceId = failedResourceId;

            return this;
        }

        /**
         * Constructs an instance of SectionParameters
         * @return an instance of SectionParameters
         */
        public SectionParameters build() {
            return new SectionParameters(this);
        }
    }

    /**
     * Private constructor. Not for public consumption
     */
    private SectionParameters(Builder builder) {
        this.headerResourceId = builder.headerResourceId;
        this.footerResourceId = builder.footerResourceId;
        this.itemResourceId = builder.itemResourceId;
        this.loadingResourceId = builder.loadingResourceId;
        this.failedResourceId = builder.failedResourceId;
    }
}

@@ -61,23 +61,18 @@
 %0A * 
-POJO which acts
+Class used
  as 
@@ -115,17 +115,8 @@
 tion
- Sections
 %7D.%0A 
@@ -389,72 +389,36 @@
 der 
-pattern mentioned by Joshua Bloch in Effective Java, 2nd Edition
+of %7B@link SectionParameters%7D
 %0A   
@@ -697,61 +697,63 @@
  * C
-reate a Builder object to construct SectionParameters
+onstructor with mandatory parameters of %7B@link Section%7D
 %0A   
@@ -999,32 +999,16 @@
 s header
- of this builder
 %0A       
@@ -1334,32 +1334,16 @@
 s footer
- of this builder
 %0A       
@@ -1676,32 +1676,16 @@
 ng state
- of this builder
 %0A       
@@ -2033,24 +2033,8 @@
 tate
- of this builder
 %0A   
@@ -2334,18 +2334,13 @@
   * 
-Constructs
+Build
  an 
@@ -2545,79 +2545,8 @@
  %7D%0A%0A
-    /**%0A     * Private constructor. Not for public consumption%0A     */%0A
     

Improve javadoc