rethinkdb / rethinkdb-java

Official RethinkDB Java client
https://rethinkdb.com/api/java/
Apache License 2.0
21 stars 10 forks source link

Generate documentation on classes #21

Open NotJustAnna opened 4 years ago

NotJustAnna commented 4 years ago

By tinkering with the Python scripts to add an extra field, which may exists but I don't seem to find, which is the original, snake-case name, the following can be generated in the top-model:

public class TopModel {
    [...]

    /**
     * See <a href="https://rethinkdb.com/api/java/epoch_time">https://rethinkdb.com/api/java/epoch_time</a>
     * for specific documentation.
     */
    public EpochTime epochTime(Object expr) {
        Arguments args = new Arguments();
        args.coerceAndAdd(expr);
        return new EpochTime(args);
    }

    [...]
}

And in the object itself:

/**
 * See <a href="https://rethinkdb.com/api/java/epoch_time">https://rethinkdb.com/api/java/epoch_time</a>
 * for specific documentation.
 */
public class EpochTime extends ReqlExpr {

    public EpochTime(Object arg) {
        this(new Arguments(arg), null);
    }
    public EpochTime(Arguments args){
        this(args, null);
    }
    public EpochTime(Arguments args, OptArgs optargs) {
        super(TermType.EPOCH_TIME, args, optargs);
    }

}