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

io.deephaven.appmode.Application Maven / Gradle / Ivy

There is a newer version: 0.36.1
Show newest version
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.appmode;

import io.deephaven.annotations.BuildableStyle;
import org.immutables.value.Value.Immutable;

@Immutable
@BuildableStyle
public abstract class Application {

    public interface Builder {

        Builder id(String id);

        Builder name(String name);

        Builder fields(Fields fields);

        Application build();
    }

    public interface Factory {
        Application create();
    }

    public static Builder builder() {
        return ImmutableApplication.builder();
    }

    /**
     * The application id, should be unique and unchanging.
     *
     * @return the application id
     */
    public abstract String id();

    /**
     * The application name.
     *
     * @return the application name
     */
    public abstract String name();

    /**
     * The fields.
     *
     * @return the fields
     */
    public abstract Fields fields();

    public final ApplicationState toState(final ApplicationState.Listener appStateListener) {
        final ApplicationState state = new ApplicationState(appStateListener, id(), name());
        state.setFields(fields());
        return state;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy