org.gridkit.jvmtool.event.GenericEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sjk-stacktrace Show documentation
Show all versions of sjk-stacktrace Show documentation
Thread dumps: capture and encoding
package org.gridkit.jvmtool.event;
public class GenericEvent implements CommonEvent {
private long timestamp;
private SimpleTagCollection tags = new SimpleTagCollection();
private SimpleCounterCollection counters = new SimpleCounterCollection();
public GenericEvent() {
}
public GenericEvent(CommonEvent that) {
copyCommonEventFrom(that);
}
@Override
public long timestamp() {
return timestamp;
}
public void timestamp(long timestamp) {
this.timestamp = timestamp;
}
@Override
public SimpleCounterCollection counters() {
return counters;
}
@Override
public SimpleTagCollection tags() {
return tags;
}
protected void copyCommonEventFrom(CommonEvent event) {
timestamp(event.timestamp());
counters.clear();
counters.setAll(event.counters());
tags.clear();
tags.putAll(event.tags());
}
}