All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hubspot.chrome.devtools.client.core.dom.RGBA Maven / Gradle / Ivy

package com.hubspot.chrome.devtools.client.core.dom;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * A structure holding an RGBA color.
 */
public final class RGBA {
  private Integer r;

  private Integer g;

  private Integer b;

  private Number a;

  @JsonCreator
  public RGBA(@JsonProperty("r") Integer r, @JsonProperty("g") Integer g,
      @JsonProperty("b") Integer b, @JsonProperty("a") Number a) {
    this.r = r;
    this.g = g;
    this.b = b;
    this.a = a;
  }

  public Integer getR() {
    return r;
  }

  public Integer getG() {
    return g;
  }

  public Integer getB() {
    return b;
  }

  public Number getA() {
    return a;
  }

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

  public static final class Builder {
    private Integer r;

    private Integer g;

    private Integer b;

    private Number a;

    private Builder() {
    }

    public RGBA.Builder setR(Integer r) {
      this.r = r;
      return this;
    }

    public RGBA.Builder setG(Integer g) {
      this.g = g;
      return this;
    }

    public RGBA.Builder setB(Integer b) {
      this.b = b;
      return this;
    }

    public RGBA.Builder setA(Number a) {
      this.a = a;
      return this;
    }

    public RGBA build() {
      return new RGBA(r, g, b, a);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy