package com.peterjosling.scroball;

public class ScrobbleStatus {

  private int errorCode = 0;
  private long dbId = -1;

  public ScrobbleStatus(int errorCode) {
    this.errorCode = errorCode;
  }

  public ScrobbleStatus(int errorCode, long dbId) {
    this(errorCode);
    this.dbId = dbId;
  }

  public boolean isScrobbled() {
    return errorCode == -1;
  }

  public int getErrorCode() {
    return errorCode;
  }

  public void setScrobbled(boolean scrobbled) {
    errorCode = 0;

    if (scrobbled) {
      errorCode = -1;
    }
  }

  public void setErrorCode(int errorCode) {
    this.errorCode = errorCode;
  }

  public long getDbId() {
      return dbId;
  }

  public void setDbId(long dbId) {
    this.dbId = dbId;
  }

  @Override
  public boolean equals(Object object) {
    if (!(object instanceof ScrobbleStatus)) {
      return false;
    }

    ScrobbleStatus status = (ScrobbleStatus) object;
    return status == this || status.getErrorCode() == errorCode && status.getDbId() == dbId;
  }
}

@@ -1008,11 +1008,289 @@
 bId;%0A  %7D
+%0A%0A  @Override%0A  public String toString() %7B%0A    String value;%0A%0A    if (isScrobbled()) %7B%0A      value = %22Scrobbled%22;%0A    %7D else if (errorCode == 0) %7B%0A      value = %22Pending%22;%0A    %7D else %7B%0A      value = %22Error %22 + errorCode;%0A    %7D%0A%0A    return String.format(%22Status(%25s)%22, value);%0A  %7D
 %0A%7D%0A

Add custom ScrobbleStatus#toString()