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

com.hubspot.chrome.devtools.client.core.network.CachedResource Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.hubspot.chrome.devtools.client.core.page.ResourceType;

/**
 * Information about the cached resource.
 */
public final class CachedResource {
  private String url;

  private ResourceType type;

  private Response response;

  private Number bodySize;

  @JsonCreator
  public CachedResource(@JsonProperty("url") String url, @JsonProperty("type") ResourceType type,
      @JsonProperty("response") Response response, @JsonProperty("bodySize") Number bodySize) {
    this.url = url;
    this.type = type;
    this.response = response;
    this.bodySize = bodySize;
  }

  public String getUrl() {
    return url;
  }

  public ResourceType getType() {
    return type;
  }

  public Response getResponse() {
    return response;
  }

  public Number getBodySize() {
    return bodySize;
  }

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

  public static final class Builder {
    private String url;

    private ResourceType type;

    private Response response;

    private Number bodySize;

    private Builder() {
    }

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

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

    public CachedResource.Builder setResponse(Response response) {
      this.response = response;
      return this;
    }

    public CachedResource.Builder setBodySize(Number bodySize) {
      this.bodySize = bodySize;
      return this;
    }

    public CachedResource build() {
      return new CachedResource(url, type, response, bodySize);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy