CrashDatapublic class CrashData extends Object Crash data transfer object. Keep in sync. with the server side version. |
Fields Summary |
---|
final String | id | final String | activity | final long | time | final BuildData | buildData | final ThrowableData | throwableData | final byte[] | state |
Constructors Summary |
---|
public CrashData(String id, String activity, BuildData buildData, ThrowableData throwableData)
this.id = nonNull(id);
this.activity = nonNull(activity);
this.buildData = nonNull(buildData);
this.throwableData = nonNull(throwableData);
this.time = System.currentTimeMillis();
this.state = null;
| public CrashData(String id, String activity, BuildData buildData, ThrowableData throwableData, byte[] state)
this.id = nonNull(id);
this.activity = nonNull(activity);
this.buildData = nonNull(buildData);
this.throwableData = nonNull(throwableData);
this.time = System.currentTimeMillis();
this.state = state;
| public CrashData(DataInput in)
int dataVersion = in.readInt();
if (dataVersion != 0 && dataVersion != 1) {
throw new IOException("Expected 0 or 1. Got: " + dataVersion);
}
this.id = in.readUTF();
this.activity = in.readUTF();
this.time = in.readLong();
this.buildData = new BuildData(in);
this.throwableData = new ThrowableData(in);
if (dataVersion == 1) {
int len = in.readInt();
if (len == 0) {
this.state = null;
} else {
this.state = new byte[len];
in.readFully(this.state, 0, len);
}
} else {
this.state = null;
}
| public CrashData(String tag, Throwable throwable)
id = "";
activity = tag;
buildData = new BuildData();
throwableData = new ThrowableData(throwable);
time = System.currentTimeMillis();
state = null;
|
Methods Summary |
---|
public java.lang.String | getActivity()
return activity;
| public BuildData | getBuildData()
return buildData;
| public java.lang.String | getId()
return id;
| public byte[] | getState()
return state;
| public ThrowableData | getThrowableData()
return throwableData;
| public long | getTime()
return time;
| public java.lang.String | toString()Return a brief description of this CrashData record. The details of the
representation are subject to change.
return "[CrashData: id=" + id + " activity=" + activity + " time=" + time +
" buildData=" + buildData.toString() +
" throwableData=" + throwableData.toString() + "]";
| public void | write(java.io.DataOutput out)
// version
if (this.state == null) {
out.writeInt(0);
} else {
out.writeInt(1);
}
out.writeUTF(this.id);
out.writeUTF(this.activity);
out.writeLong(this.time);
buildData.write(out);
throwableData.write(out);
if (this.state != null) {
out.writeInt(this.state.length);
out.write(this.state, 0, this.state.length);
}
|
|