1 /*
2  * Hunt - A redis client library for D programming language.
3  *
4  * Copyright (C) 2018-2019 HuntLabs
5  *
6  * Website: https://www.huntlabs.net/
7  *
8  * Licensed under the Apache-2.0 License.
9  *
10  */
11  
12 module hunt.redis.StreamPendingEntry;
13 
14 import hunt.Exceptions;
15 import hunt.redis.StreamEntryID;
16 
17 import std.conv;
18 
19 class StreamPendingEntry { // : Serializable
20   
21   
22   private StreamEntryID id;
23   private string consumerName;
24   private long idleTime;
25   private long deliveredTimes;
26   
27   this(StreamEntryID id, string consumerName, long idleTime, long deliveredTimes) {
28     this.id = id;
29     this.consumerName = consumerName;
30     this.idleTime = idleTime;
31     this.deliveredTimes = deliveredTimes;
32   }
33   
34   StreamEntryID getID() {
35     return id;
36   }
37 
38   long getIdleTime() {
39     return idleTime;
40   }
41 
42   long getDeliveredTimes() {
43     return deliveredTimes;
44   }
45 
46   string getConsumerName() {
47     return consumerName;
48   }
49   
50   override
51   string toString() {
52     return this.id.toString() ~ " " ~ this.consumerName ~ " idle:" ~ 
53         this.idleTime.to!string() ~ " times:" ~ this.deliveredTimes.to!string();
54   }
55   
56   // private void writeObject(java.io.ObjectOutputStream out) {
57   //   out.writeUnshared(this.id);
58   //   out.writeUTF(this.consumerName);
59   //   out.writeLong(idleTime);
60   //   out.writeLong(this.deliveredTimes);
61   // }
62   
63   // private void readObject(java.io.ObjectInputStream in) {
64   //   this.id = (StreamEntryID) in.readUnshared();
65   //   this.consumerName = in.readUTF();
66   //   this.idleTime = in.readLong();
67   //   this.deliveredTimes = in.readLong();
68   // }
69 
70 }