/*
 * JBoss, Home of Professional Open Source
 * Copyright Red Hat, Inc., and individual contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.aerogear.webpush;

import java.time.LocalDateTime;
import java.util.Objects;

public class PushMessage {  //FIXME should it be serializable?

    private final String data;
    private final String path;
    private final LocalDateTime createdDateTime;
    private final LocalDateTime receivedDateTime;

    public PushMessage(final String data,
                       final String path,
                       final LocalDateTime createdDateTime,
                       final LocalDateTime receivedDateTime) {
        Objects.requireNonNull(data, "data");
        Objects.requireNonNull(path, "path");
        this.data = data;
        this.path = path;
        this.createdDateTime = createdDateTime;
        this.receivedDateTime = receivedDateTime;
    }

    public String data() {
        return data;
    }

    public String path() {
        return path;
    }

    public LocalDateTime createdDateTime() {
        return createdDateTime;
    }

    public LocalDateTime receivedDateTime() {
        return receivedDateTime;
    }

    @Override
    public String toString() {
        return "PushMessage{" +
                "data='" + data + '\'' +
                ", path='" + path + '\'' +
                ", createdDateTime=" + createdDateTime +
                ", receivedDateTime=" + receivedDateTime +
                '}';
    }
}

@@ -838,20 +838,20 @@
  String 
-data
+path
 ;%0A    pr
@@ -861,36 +861,36 @@
 te final String 
-path
+data
 ;%0A    private fi
@@ -1011,20 +1011,20 @@
  String 
-data
+path
 ,%0A      
@@ -1045,36 +1045,36 @@
    final String 
-path
+data
 ,%0A              
@@ -1217,19 +1217,19 @@
 ull(
-data, %22data
+path, %22path
 %22);%0A
@@ -1255,35 +1255,35 @@
 uireNonNull(
-path, %22path
+data, %22data
 %22);%0A        
@@ -1291,19 +1291,19 @@
 his.
-data = data
+path = path
 ;%0A  
@@ -1309,35 +1309,35 @@
        this.
-path = path
+data = data
 ;%0A        th
@@ -1707,24 +1707,389 @@
 ime;%0A    %7D%0A%0A
+    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (!(o instanceof PushMessage)) %7B%0A            return false;%0A        %7D%0A        PushMessage that = (PushMessage) o;%0A        return path.equals(that.path);%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return Objects.hash(path);%0A    %7D%0A%0A
     @Overrid
@@ -2174,22 +2174,22 @@
    %22
-data
+path
 ='%22 + 
-data
+path
  + '
@@ -2213,30 +2213,30 @@
      %22, 
-path
+data
 ='%22 + 
-path
+data
  + '%5C'' 

Implement equals() and hashCode() for PushMessage entity