Created
April 30, 2016 16:35
-
-
Save pittersnider/694aec980a25bab5cd47c9467dd2c650 to your computer and use it in GitHub Desktop.
₢ Serpentine
This file contains hidden or 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
// Created by ReedFlake <[email protected]> | |
// Copyright © Serpentine Library (Phaed). | |
Serpent data = new Serpent("test"); | |
data.addMap("mapa1"); | |
data.selectLast(); | |
data.addKey("user-id", 2, Integer.class, UUID.class); | |
data.setArgumentName("id", 1, "id"); | |
data.setArgumentName("id", 2, "uuid"); | |
data.addKey("username", 1, String.class); | |
data.addKey("password", 1, String.class); | |
data.finishSelected(); | |
Serpentine map = data.section("mapa1"); | |
map.addElements( new Object[] { map.increment(), UUID.randomUUID(); }, "ReedFlake", "123456789@" ); | |
File storage = new File("teste.spt"); | |
Launcher output = data.serialize(); | |
output.save(storage); | |
Launcher input = Serpentine.as(storage); | |
input.start(); //0.02s | |
data = input.as(); | |
System.out.println("UUID: " + data.select("mapa1").parse("user-id").as("uuid").toString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment