Notes:
Buddy class is Database friendly and is basically a Pair with a creation date.
The method buddyOf returns a Nullable because Java 8 Optionnal's are not available in this project.
Because the hash function used is symmetric we can just push the database and be confident that there will be no doublons, we might override a friendship(change the date), but this is fine.
The reason why the hash function should be symmetric is that we would like arbitrary constant access to a particular location in the buddies table.
31
Notes:
Buddy
class is Database friendly and is basically aPair
with a creation date. The methodbuddyOf
returns aNullable
because Java 8 Optionnal's are not available in this project. Because the hash function used is symmetric we can just push the database and be confident that there will be no doublons, we might override a friendship(change the date), but this is fine.The reason why the hash function should be symmetric is that we would like arbitrary constant access to a particular location in the buddies table.