class ColorBarBuilder {

    private ThicknessMode thicknessMode = DEFAULT_THICKNESS_MODE;

    private double thickness = DEFAULT_THICKNESS; // (number greater than or equal to 0)

    private LenMode lenMode = DEFAULT_LEN_MODE;

    private double len = DEFAULT_LEN;

    private double x = DEFAULT_X;

    private int xPad = DEFAULT_X_PAD;

    private int yPad = DEFAULT_Y_PAD;

    private double y = DEFAULT_Y;

    private Xanchor xAnchor = DEFAULT_X_ANCHOR;

    private Yanchor yAnchor = DEFAULT_Y_ANCHOR;

    private String outlineColor = DEFAULT_OUTLINE_COLOR;

    private int outlineWidth = DEFAULT_OUTLINE_WIDTH;

    private String borderColor = DEFAULT_BORDER_COLOR;

    private int borderWidth = DEFAULT_BORDER_WIDTH;

    private String bgColor = DEFAULT_BG_COLOR;

    private TickSettings tickSettings;

    /**
     * Sets the thickness of the color bar, This measure excludes the size of the padding, ticks and
     * labels.
     *
     * @param thickness a double greater than 0
     * @return this ColorBar
     */
    public ColorBarBuilder thickness(double thickness) {
      Preconditions.checkArgument(thickness >= 0);
      this.thickness = thickness;
      return this;
    }

    /**
     * Sets the length of the color bar, This measure excludes the size of the padding, ticks and
     * labels.
     *
     * @param len a double greater than 0
     * @return this ColorBar
     */
    public ColorBarBuilder len(double len) {
      Preconditions.checkArgument(len >= 0);
      this.len = len;
      return this;
    }

    /**
     * Determines whether this color bar's length (i.e. the measure in the color variation
     * direction) is set in units of plot "fraction" or in "pixels. Use `len` to set the value.
     */
    public ColorBarBuilder lenMode(LenMode lenMode) {
      this.lenMode = lenMode;
      return this;
    }

    public ColorBarBuilder thicknessMode(ThicknessMode mode) {
      this.thicknessMode = mode;
      return this;
    }

    /**
     * A number between or equal to -2and 3) default:1.02 Sets the x position of the color bar(in
     * plot fraction).
     */
    public ColorBarBuilder x(double x) {
      Preconditions.checkArgument(x >= -2 && x <= 3);
      this.x = x;
      return this;
    }

    /**
     * A number between or equal to -2and 3) default:0.5 Sets the y position of the color bar (in
     * plot fraction).
     */
    public ColorBarBuilder y(double y) {<FILL_FUNCTION_BODY>}

    /**
     * Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the
     * "left", "center" or "right" of the color bar.
     */
    public ColorBarBuilder xAnchor(Xanchor xAnchor) {
      this.xAnchor = xAnchor;
      return this;
    }

    /**
     * Sets this color bar's vertical position anchor This anchor binds the `y` position to the
     * "top", "middle" or "bottom" of the color bar.
     */
    public ColorBarBuilder yAnchor(Yanchor yAnchor) {
      this.yAnchor = yAnchor;
      return this;
    }

    /** Sets the amount of paddng (in px) along the y direction. */
    public ColorBarBuilder yPad(int yPad) {
      Preconditions.checkArgument(yPad >= 0);
      this.yPad = yPad;
      return this;
    }

    /** Sets the amount of padding(in px) along the x direction. */
    public ColorBarBuilder xPad(int xPad) {
      Preconditions.checkArgument(y >= 0);
      this.xPad = xPad;
      return this;
    }

    /** Sets the axis line color. */
    public ColorBarBuilder outlineColor(String outlineColor) {
      this.outlineColor = outlineColor;
      return this;
    }

    /** Sets the color of the border enclosing this color bar. */
    public ColorBarBuilder borderColor(String color) {
      this.borderColor = color;
      return this;
    }

    /** Sets the color of padded area. */
    public ColorBarBuilder bgColor(String color) {
      this.bgColor = color;
      return this;
    }

    /** Sets the width (in px) or the border enclosing this color bar. */
    public ColorBarBuilder borderWidth(int width) {
      Preconditions.checkArgument(width >= 0);
      this.borderWidth = width;
      return this;
    }

    /** Sets the width (in px) of the axis line. */
    public ColorBarBuilder outlineWidth(int width) {
      Preconditions.checkArgument(width >= 0);
      this.outlineWidth = width;
      return this;
    }

    public ColorBarBuilder tickSettings(TickSettings tickSettings) {
      this.tickSettings = tickSettings;
      return this;
    }

    public ColorBar build() {
      return new ColorBar(this);
    }
  }

      Preconditions.checkArgument(y >= -2 && y <= 3);
      this.y = y;
      return this;
    
<methods>public non-sealed void <init>() ,public java.lang.String asJSON() ,public abstract java.lang.String asJavascript() ,public java.lang.String toString() <variables>private final PebbleEngine engine,protected static final ObjectMapper mapper