All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.Vari.hbs Maven / Gradle / Ivy

There is a newer version: 0.15.3
Show newest version
package {{packageName}};

import io.polyapi.client.internal.proxy.PolyProxyFactory;
import io.polyapi.client.internal.model.PolyContext;
import io.polyapi.client.api.AuthTokenEventConsumer;
import io.polyapi.client.api.model.PolyEntity;
import io.polyapi.client.api.AuthTokenOptions;
import io.polyapi.commons.api.model.PolyGeneratedClass;
{{~#each this.imports}}
import {{{this}}};
{{~/each}}

@PolyGeneratedClass
public class {{className}} extends PolyContext {

{{~#each serverVariableSpecifications}}
    private static final {{this.className}} {{this.name}};
{{~/each}}
{{#each subcontexts}}
    public static final {{this.className}} {{this.name}};
{{~/each}}

    static {
        Vari vari = new Vari();
{{~#each serverVariableSpecifications}}
        {{this.name}} = vari.createServerVariableHandler({{this.className}}.class);
{{~/each}}
{{#each subcontexts}}
        {{this.name}} = vari.createSubContext({{this.className}}.class);
{{~/each}}
    }

{{~#each serverVariableSpecification}}
    public static void update{{{className}}}Variable({{{valueType}}} value) {
        this.{{name}}Handler.update(value);
    }

    {{~#if secret}}
    {{~else}}
    public static {{{valueType}}} get{{{className}}}Variable() {
        return this.{{name}}Handler.get();
    }
    {{/if}}
{{~/each}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy