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

com.powsybl.openrao.data.cracio.commons.api.ElementaryCreationContext Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2021, RTE (http://www.rte-france.com)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package com.powsybl.openrao.data.cracio.commons.api;

import java.util.Set;

/**
 * @author Godelaine de Montmorillon {@literal }
 */
public interface ElementaryCreationContext {

    /**
     * Get a unique identifier of the element in the native Crac.
     */
    String getNativeObjectId();

    /**
     * Get the (optional) name of the element in the native Crac.
     */
    String getNativeObjectName();

    /**
     * Get a unique identifier of the element in the created Crac.
     */
    String getCreatedObjectId();

    /**
     * Get the identifiers of the elements in the created Crac.
     */
    default Set getCreatedObjectsIds() {
        return getCreatedObjectId() != null ? Set.of(getCreatedObjectId()) : Set.of();
    }

    /**
     * Indicates if element has been imported.
     */
    default boolean isImported() {
        return ImportStatus.IMPORTED.equals(getImportStatus());
    }

    /**
     * Indicates if element has been altered.
     */
    boolean isAltered();

    /**
     * Returns status detailing import situation.
     */
    ImportStatus getImportStatus();

    /**
     * Returns additional information on import context.
     */
    String getImportStatusDetail();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy