templates.Vari.hbs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polyapi-maven-plugin Show documentation
Show all versions of polyapi-maven-plugin Show documentation
Maven plugin to run handle Poly API functions.
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}}
}