shz.IdPayload Maven / Gradle / Ivy
package shz;
import java.io.Serializable;
public final class IdPayload implements Serializable {
private static final long serialVersionUID = -8759026411178181848L;
private final ID id;
private final T payload;
private IdPayload(ID id, T payload) {
this.id = id;
this.payload = payload;
}
public static IdPayload of(ID id, T payload) {
return new IdPayload<>(id, payload);
}
public static IdPayload of(ID id) {
return new IdPayload<>(id, null);
}
public ID id() {
return id;
}
public T payload() {
return payload;
}
@Override
public String toString() {
return "IdPayload{" +
"id=" + id +
", payload=" + payload +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy