Swiftbird is a library created for Leaf that allows the creation of what we call
"Property" (a.k.a Setting).
The default implementation wrote by Shyrogan is annotation-based
(see the Default Implementation section).
Declaring a property works with annotation:
class Configuration {
@Property(value = "Cheese", description = "It adds cheese, I guess?")
private boolean cheese = false;
}
will tell Swiftbird to considere the cheese
field as a property.
In order to retrieve your properties, you have to create a Swiftbird
instance using the create()
method.
Then, you can get the properties in their PropertyContainer form.
class Main {
private final Swiftbird swiftbird = Swiftbird.create();
public static void main(String[] args) {
List<PropertyContainer<?>> properties = swiftbird.in(new Configuration());
}
}