Created
March 15, 2014 21:00
-
-
Save Ribesg/9573836 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Transaction deserialize(LinkedHashMap section) { | |
if(!section.containsKey("sender") || | |
!section.containsKey("itemstack") || | |
!section.containsKey("timestamp") || | |
!section.containsKey("lifetime")) { | |
return null; | |
} | |
final String sender = section.getString("sender"); | |
final ItemStack is = section.getItemStack("itemstack"); | |
final long timestamp = section.getLong("timestamp"); | |
final long lifetime = section.getLong("lifetime"); | |
return new Transaction(sender, is, timestamp, lifetime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment