Skip to content
Jonathan edited this page Jan 24, 2021 · 1 revision

Data class provides ways of specifying properties and their types, example:

public void main(String[] args) {
    Super.Data data = Super.newData("User").properties("name", "email", String.class)
}

In kotlin:

fun main(args: Array<String>) {
    val data = newData("User") {
        props<String>("name", "email")
    }
}

DataFiller

DataFillers are responsible of filling the data, Data types are only representation of a Shape, when you have an object which fits the Data representation, you have a Data of the specified type.

The type responsible of filling the data, and thus, creating a FilledData is the DataFiller, example:

public class MyDataFiller implements DataFiler<Map<?, ?>> {
    @Override
    public Type getType() {
        // ....
    }
    
    @Override
    public void fill(Map<?, ?> obj, Type type, FilledDataWriter writer) {
        // ....
    }
}

TODO

Clone this wiki locally