mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-06 02:49:57 +08:00
云快充1.5.0 初始化
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 抖音关注:程序员三丙
|
||||
* 知识星球:https://t.zsxq.com/j9b21
|
||||
*/
|
||||
package sanbing.jcpp.infrastructure.queue;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProtoQueueMsg<T extends com.google.protobuf.GeneratedMessageV3> implements QueueMsg {
|
||||
|
||||
private final String key;
|
||||
protected final T value;
|
||||
private final QueueMsgHeaders headers;
|
||||
|
||||
public ProtoQueueMsg(String key, T value) {
|
||||
this(key, value, new DefaultQueueMsgHeaders());
|
||||
}
|
||||
|
||||
public ProtoQueueMsg(String key, T value, QueueMsgHeaders headers) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
this.headers = headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueueMsgHeaders getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getData() {
|
||||
return value.toByteArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user