![JAR search and dependency download from the Maven repository](/logo.png)
com.powsybl.cgmes.extensions.CimCharacteristicsAdderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powsybl-cgmes-extensions Show documentation
Show all versions of powsybl-cgmes-extensions Show documentation
A set of CGMES common extensions
/**
* Copyright (c) 2020, 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/.
* SPDX-License-Identifier: MPL-2.0
*/
package com.powsybl.cgmes.extensions;
import com.powsybl.commons.PowsyblException;
import com.powsybl.commons.extensions.AbstractExtensionAdder;
import com.powsybl.iidm.network.Network;
/**
* @author Miora Ralambotiana {@literal }
*/
class CimCharacteristicsAdderImpl extends AbstractExtensionAdder implements CimCharacteristicsAdder {
private CgmesTopologyKind cgmesTopologyKind;
private int cimVersion = -1;
CimCharacteristicsAdderImpl(Network extendable) {
super(extendable);
}
@Override
public CimCharacteristicsAdder setTopologyKind(CgmesTopologyKind cgmesTopologyKind) {
this.cgmesTopologyKind = cgmesTopologyKind;
return this;
}
@Override
public CimCharacteristicsAdder setCimVersion(int cimVersion) {
this.cimVersion = cimVersion;
return this;
}
@Override
protected CimCharacteristics createExtension(Network extendable) {
if (cgmesTopologyKind == null) {
throw new PowsyblException("CimCharacteristics.topologyKind is undefined");
}
if (cimVersion == -1) {
throw new PowsyblException("CimCharacteristics.cimVersion is undefined");
}
return new CimCharacteristicsImpl(cgmesTopologyKind, cimVersion);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy