]> git.somenet.org - pub/jan/dst18.git/blob - ass3-messaging/src/main/java/dst/ass3/messaging/WorkerResponse.java
[3.2-java] der meh part. like srsly docker-java? -.-
[pub/jan/dst18.git] / ass3-messaging / src / main / java / dst / ass3 / messaging / WorkerResponse.java
1 package dst.ass3.messaging;
2
3 import java.util.Objects;
4
5 /**
6  * Message sent by a worker after it is finished processing a request.
7  */
8 public class WorkerResponse {
9
10     /**
11      * The ID of the original {@link UploadRequest}.
12      */
13     private String requestId;
14
15     /**
16      * The time it took to process the request (in milliseconds).
17      */
18     private Long processingTime;
19
20     public String getRequestId() {
21         return requestId;
22     }
23
24     public void setRequestId(String requestId) {
25         this.requestId = requestId;
26     }
27
28     public Long getProcessingTime() {
29         return processingTime;
30     }
31
32     public void setProcessingTime(Long processingTime) {
33         this.processingTime = processingTime;
34     }
35
36     @Override
37     public boolean equals(Object o) {
38         if (this == o) {
39             return true;
40         }
41         if (o == null || getClass() != o.getClass()) {
42             return false;
43         }
44         WorkerResponse that = (WorkerResponse) o;
45         return Objects.equals(requestId, that.requestId) &&
46                 Objects.equals(processingTime, that.processingTime);
47     }
48
49     @Override
50     public int hashCode() {
51         return Objects.hash(requestId, processingTime);
52     }
53
54     @Override
55     public String toString() {
56         return "WorkerResponse{" +
57                 "requestId='" + requestId + '\'' +
58                 ", processingTime=" + processingTime +
59                 '}';
60     }
61 }