Skip to content

Instantly share code, notes, and snippets.

@Ribesg
Created March 15, 2014 21:00
Show Gist options
  • Save Ribesg/9573836 to your computer and use it in GitHub Desktop.
Save Ribesg/9573836 to your computer and use it in GitHub Desktop.
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