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

com.hubspot.chrome.devtools.client.core.page.FrameResource Maven / Gradle / Ivy

There is a newer version: 94.0.4606.61
Show newest version
package com.hubspot.chrome.devtools.client.core.page;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.hubspot.chrome.devtools.client.core.network.TimeSinceEpoch;

/**
 * Information about the Resource on the page.
 */
public final class FrameResource {
  private String url;

  private ResourceType type;

  private String mimeType;

  private TimeSinceEpoch lastModified;

  private Number contentSize;

  private Boolean failed;

  private Boolean canceled;

  @JsonCreator
  public FrameResource(@JsonProperty("url") String url, @JsonProperty("type") ResourceType type,
      @JsonProperty("mimeType") String mimeType,
      @JsonProperty("lastModified") TimeSinceEpoch lastModified,
      @JsonProperty("contentSize") Number contentSize, @JsonProperty("failed") Boolean failed,
      @JsonProperty("canceled") Boolean canceled) {
    this.url = url;
    this.type = type;
    this.mimeType = mimeType;
    this.lastModified = lastModified;
    this.contentSize = contentSize;
    this.failed = failed;
    this.canceled = canceled;
  }

  public String getUrl() {
    return url;
  }

  public ResourceType getType() {
    return type;
  }

  public String getMimeType() {
    return mimeType;
  }

  public TimeSinceEpoch getLastModified() {
    return lastModified;
  }

  public Number getContentSize() {
    return contentSize;
  }

  public Boolean getFailed() {
    return failed;
  }

  public Boolean getCanceled() {
    return canceled;
  }

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

  public static final class Builder {
    private String url;

    private ResourceType type;

    private String mimeType;

    private TimeSinceEpoch lastModified;

    private Number contentSize;

    private Boolean failed;

    private Boolean canceled;

    private Builder() {
    }

    public FrameResource.Builder setUrl(String url) {
      this.url = url;
      return this;
    }

    public FrameResource.Builder setType(ResourceType type) {
      this.type = type;
      return this;
    }

    public FrameResource.Builder setMimeType(String mimeType) {
      this.mimeType = mimeType;
      return this;
    }

    public FrameResource.Builder setLastModified(TimeSinceEpoch lastModified) {
      this.lastModified = lastModified;
      return this;
    }

    public FrameResource.Builder setContentSize(Number contentSize) {
      this.contentSize = contentSize;
      return this;
    }

    public FrameResource.Builder setFailed(Boolean failed) {
      this.failed = failed;
      return this;
    }

    public FrameResource.Builder setCanceled(Boolean canceled) {
      this.canceled = canceled;
      return this;
    }

    public FrameResource build() {
      return new FrameResource(url, type, mimeType, lastModified, contentSize, failed, canceled);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy