jav / expo-server-sdk-java

Expo server SDK in java
MIT License
21 stars 23 forks source link

ExpoPushMessage not equal to the same ExpoPushMessage #6

Closed Bryksin closed 4 years ago

Bryksin commented 4 years ago

Hi

Had to build a Map<ExpoPushMessage, SomeOtherStuff> and unfortunately, realised that mymap.get(expoPushMessage) is null Because mymap.get(expoPushMessage) == expoPushMessage is false or mymap.get(expoPushMessage).equals(expoPushMessage) is also false

I would imagine ExpoPushMessage need to implement equals() and hashcode()

aditionally would be very nice if you would implement nice toString(), so if you print ExpoPushMessage or ExpoPushTicket it will print nicely, instead of going through each getter manually.

jav commented 4 years ago

Done https://github.com/jav/expo-server-sdk-java/pull/8

ExpoPushMessage, ExpoPushTicket and ExpoPushReceipt now all implement hashCode() and equals().