11package rockset .models ;
22
33import com .fasterxml .jackson .annotation .JsonProperty ;
4+ import com .google .common .base .Objects ;
45import com .google .gson .annotations .SerializedName ;
56import io .swagger .annotations .ApiModelProperty ;
6- import java .util .Objects ;
77
88public class KafkaMessage {
99
@@ -23,6 +23,12 @@ public class KafkaMessage {
2323 @ SerializedName ("key" )
2424 public Object key ;
2525
26+ @ SerializedName ("create_time" )
27+ public Long createTime ;
28+
29+ @ SerializedName ("log_append_time" )
30+ public Long logAppendTime ;
31+
2632 /*
2733 * Getters
2834 */
@@ -51,6 +57,19 @@ public Object getKey() {
5157 return this .key ;
5258 }
5359
60+ @ JsonProperty ("create_time" )
61+ @ ApiModelProperty (required = false , value = "Create time of the message" )
62+ public Long getCreateTime () {
63+ return this .createTime ;
64+ }
65+
66+ @ JsonProperty ("log_append_time" )
67+ @ ApiModelProperty (required = false , value = "Log append time of the message" )
68+ public Long getLogAppendTime () {
69+ return this .logAppendTime ;
70+ }
71+
72+
5473 /*
5574 * Setters
5675 */
@@ -71,6 +90,16 @@ public void setKey(Object key) {
7190 this .key = key ;
7291 }
7392
93+
94+ public void setLogAppendTime (Long timestamp ) {
95+ this .logAppendTime = timestamp ;
96+ }
97+
98+ public void setCreateTime (Long timestamp ) {
99+ this .createTime = timestamp ;
100+ }
101+
102+
74103 /*
75104 * Builders
76105 */
@@ -95,6 +124,16 @@ public KafkaMessage key(Object key) {
95124 return this ;
96125 }
97126
127+ public KafkaMessage logAppendTime (Long timestamp ) {
128+ this .logAppendTime = timestamp ;
129+ return this ;
130+ }
131+
132+ public KafkaMessage createTime (Long timestamp ) {
133+ this .createTime = timestamp ;
134+ return this ;
135+ }
136+
98137 /*
99138 * Utilities
100139 */
@@ -107,35 +146,27 @@ private String toIndentedString(java.lang.Object o) {
107146 }
108147
109148 @ Override
110- public String toString () {
111- final StringBuilder sb = new StringBuilder ();
112- sb .append ("class KafkaMessage {\n " );
113-
114- sb .append (" partition: " ).append (this .toIndentedString (this .partition )).append ("\n " );
115- sb .append (" offset: " ).append (this .toIndentedString (this .offset )).append ("\n " );
116- sb .append (" document: " ).append (this .toIndentedString (this .document )).append ("\n " );
117- sb .append (" key: " ).append (this .toIndentedString (this .key )).append ("\n " );
118- sb .append ("}" );
119- return sb .toString ();
149+ public boolean equals (Object o ) {
150+ if (this == o ) return true ;
151+ if (o == null || getClass () != o .getClass ()) return false ;
152+ KafkaMessage that = (KafkaMessage ) o ;
153+ return partition == that .partition && offset == that .offset && Objects .equal (document , that .document ) && Objects .equal (key , that .key ) && Objects .equal (createTime , that .createTime ) && Objects .equal (logAppendTime , that .logAppendTime );
120154 }
121155
122156 @ Override
123157 public int hashCode () {
124- return Objects .hash ( this . document , this . partition , this . offset , this . key );
158+ return Objects .hashCode ( document , partition , offset , key , createTime , logAppendTime );
125159 }
126160
127161 @ Override
128- public boolean equals (java .lang .Object o ) {
129- if (this == o ) {
130- return true ;
131- }
132- if (o == null || this .getClass () != o .getClass ()) {
133- return false ;
134- }
135- final KafkaMessage kafkaMessage = (KafkaMessage ) o ;
136- return this .getPartition () == kafkaMessage .getPartition ()
137- && this .getOffset () == kafkaMessage .getOffset ()
138- && Objects .equals (this .document , kafkaMessage .document )
139- && Objects .equals (this .key , kafkaMessage .key );
162+ public String toString () {
163+ return "KafkaMessage{" +
164+ "document=" + document +
165+ ", partition=" + partition +
166+ ", offset=" + offset +
167+ ", key=" + key +
168+ ", createTime=" + createTime +
169+ ", logAppendTime=" + logAppendTime +
170+ '}' ;
140171 }
141172}
0 commit comments