import com.yamlesque.Yamlesque;
public class Main {
public static void main(String[] args) {
String yamlData = "name: John Doe
age: 30";
Object yamlObject = Yamlesque.toObject(yamlData);
String name = Yamlesque.get(yamlObject, "name");
int age = Yamlesque.get(yamlObject, "age");
System.out.println("Name: " + name);
System.out.println("Age: " + age);
}
}
yaml
debug: true
output:
format: "json"
filename: "output.json"
import com.yamlesque.Yamlesque;
public class Main {
public static void main(String[] args) {
Yamlesque.loadConfig("path/to/example.yml");
boolean debug = Yamlesque.getConfig("debug");
String format = Yamlesque.getConfig("output.format");
String filename = Yamlesque.getConfig("output.filename");
System.out.println("Debug: " + debug);
System.out.println("Output format: " + format);
System.out.println("Output filename: " + filename);
}
}