package com.hubspot.blazar.base;

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

public class MalformedFile {
  private final int branchId;
  private final String type;
  private final String path;
  private final String details;

  @JsonCreator
  public MalformedFile(@JsonProperty("branchId") int branchId,
                       @JsonProperty("type") String type,
                       @JsonProperty("path") String path,
                       @JsonProperty("details") String details) {
    this.branchId = branchId;
    this.type = type;
    this.path = path;
    this.details = details;
  }

  public int getBranchId() {
    return branchId;
  }

  public String getType() {
    return type;
  }

  public String getPath() {
    return path;
  }

  public String getDetails() {
    return details;
  }
}

@@ -133,16 +133,55 @@
 roperty;
+%0Aimport com.google.common.base.Objects;
 %0A%0Apublic
@@ -900,11 +900,504 @@
 ils;%0A  %7D
+%0A%0A  @Override%0A  public boolean equals(Object o) %7B%0A    if (this == o) %7B%0A      return true;%0A    %7D%0A    if (o == null %7C%7C getClass() != o.getClass()) %7B%0A      return false;%0A    %7D%0A    MalformedFile that = (MalformedFile) o;%0A    return branchId == that.branchId &&%0A        Objects.equal(type, that.type) &&%0A        Objects.equal(path, that.path) &&%0A        Objects.equal(details, that.details);%0A  %7D%0A%0A  @Override%0A  public int hashCode() %7B%0A    return Objects.hashCode(branchId, type, path, details);%0A  %7D
 %0A%7D%0A

improve malformed files object allow hubspot-discoveries to handle multiple errors for a single file