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

io.deephaven.server.plugin.js.JsPluginManifestEntry Maven / Gradle / Ivy

The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.server.plugin.js;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.deephaven.annotations.SimpleStyle;
import io.deephaven.plugin.js.JsPlugin;
import org.immutables.value.Value.Immutable;
import org.immutables.value.Value.Parameter;

/**
 * @see js-plugin-template
 */
@Immutable
@SimpleStyle
public abstract class JsPluginManifestEntry {

    public static final String NAME = "name";
    public static final String VERSION = "version";
    public static final String MAIN = "main";

    @JsonCreator
    public static JsPluginManifestEntry of(
            @JsonProperty(value = NAME, required = true) String name,
            @JsonProperty(value = VERSION, required = true) String version,
            @JsonProperty(value = MAIN, required = true) String main) {
        return ImmutableJsPluginManifestEntry.of(name, version, main);
    }

    public static JsPluginManifestEntry from(JsPlugin plugin) {
        return of(plugin.name(), plugin.version(), plugin.main().toString());
    }

    /**
     * The name of the plugin.
     */
    @Parameter
    @JsonProperty(NAME)
    public abstract String name();

    /**
     * The version of the plugin.
     */
    @Parameter
    @JsonProperty(VERSION)
    public abstract String version();

    /**
     * The main js file.
     */
    @Parameter
    @JsonProperty(MAIN)
    public abstract String main();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy