Class SubnetworkImpl

java.lang.Object
com.powsybl.commons.extensions.AbstractExtendable<I>
com.powsybl.iidm.network.impl.SubnetworkImpl
All Implemented Interfaces:
Extendable<Network>, Container<Network>, Identifiable<Network>, MultiVariantObject, NetworkExt, Network, Validable

public class SubnetworkImpl extends AbstractExtendable<I>
Author:
Miora Vedelago <miora.ralambotiana at rte-france.com>
  • Field Details

    • sourceFormat

      protected String sourceFormat
    • id

      protected String id
    • name

      protected String name
    • fictitious

      protected boolean fictitious
    • properties

      protected final Properties properties
  • Method Details

    • getRootNetworkRef

      public RefChain<com.powsybl.iidm.network.impl.NetworkImpl> getRootNetworkRef()
      Description copied from interface: NetworkExt
      Return the reference to the root network which is also used within the network elements. This is used to easily update the root network of network elements when merging networks or detaching subnetworks.
    • getSubnetworks

      public final Collection<Network> getSubnetworks()
    • getSubnetwork

      public final Network getSubnetwork(String id)
    • getNetwork

      public com.powsybl.iidm.network.impl.NetworkImpl getNetwork()
      Description copied from interface: Identifiable
      Get the network associated to the object.
      Specified by:
      getNetwork in interface Identifiable<Network>
    • getVariantManager

      public VariantManager getVariantManager()
      Description copied from interface: Network
      Get the variant manager of the network.
    • allowReporterContextMultiThreadAccess

      public void allowReporterContextMultiThreadAccess(boolean allow)
      Description copied from interface: Network

      Allows ReporterContext to be accessed simultaneously by different threads.

      When this option is activated, the reporter context can have a different content for each thread.

      Note that to avoid memory leaks when in multi-thread configuration:

      • each reporter pushed in the ReporterContext should be popped in a "finally" section:
         
             network.getReporterContext().pushReporter(reporter);
             try {
                 // code that can throw an exception
             } finally {
                 network.getReporterContext().popReporter();
             }
         
         
      • the context should be set in mono-thread access when multi-threading policy is no more useful.
      Parameters:
      allow - allow multi-thread access to the ReporterContext
    • getReporterContext

      public ReporterContext getReporterContext()
      Description copied from interface: Network
      Get the ReporterContext of the network.
    • getCountries

      public Set<Country> getCountries()
      Description copied from interface: Network
      Get all countries.
    • getCountryCount

      public int getCountryCount()
      Description copied from interface: Network
      Get the country count.
    • newSubstation

      public SubstationAdder newSubstation()
      Description copied from interface: Network
      Get a builder to create a new substation.
      Returns:
      a builder to create a new substation
    • getSubstations

      public Iterable<Substation> getSubstations()
      Description copied from interface: Network
      Get all substations.
    • getSubstationStream

      public Stream<Substation> getSubstationStream()
      Description copied from interface: Network
      Get all substations.
    • getSubstationCount

      public int getSubstationCount()
      Description copied from interface: Network
      Get the substation count.
    • getSubstations

      public Iterable<Substation> getSubstations(Country country, String tsoId, String... geographicalTags)
      Description copied from interface: Network
      Get substation located in a specific county, TSO and marked with a list of geographical tag.
      Parameters:
      country - the country, if null there is no filtering on countries
      tsoId - the id of the TSO, if null there is no filtering on TSOs
      geographicalTags - a list a geographical tags
    • getSubstations

      public Iterable<Substation> getSubstations(String country, String tsoId, String... geographicalTags)
      Description copied from interface: Network
      Get substation located in a specific county, TSO and marked with a list of geographical tag.
      Parameters:
      country - the country name, if empty string, the filtering will be on substations without country, if null there is no filtering on countries
      tsoId - the id of the TSO, if null there is no filtering on TSOs
      geographicalTags - a list a geographical tags
    • getSubstation

      public Substation getSubstation(String id)
      Description copied from interface: Network
      Get a substation.
      Parameters:
      id - the id or an alias of the substation
    • newVoltageLevel

      public VoltageLevelAdder newVoltageLevel()
      Description copied from interface: Network
      Get a builder to create a new voltage level (without substation). Note: if this method is not implemented, it will create an intermediary fictitious Substation.
      Returns:
      a builder to create a new voltage level
    • getVoltageLevels

      public Iterable<VoltageLevel> getVoltageLevels()
      Description copied from interface: Network
      Get all substation voltage levels.
    • getVoltageLevelStream

      public Stream<VoltageLevel> getVoltageLevelStream()
      Description copied from interface: Network
      Get all substation voltage levels.
    • getVoltageLevelCount

      public int getVoltageLevelCount()
      Description copied from interface: Network
      Get the voltage level count.
    • getVoltageLevel

      public VoltageLevel getVoltageLevel(String id)
      Description copied from interface: Network
      Get a substation voltage level.
      Parameters:
      id - the id or an alias of the substation voltage level
    • newLine

      public LineAdder newLine()
      Description copied from interface: Network
      Get a builder to create a new AC line.
      Returns:
      a builder to create a new line
    • getLines

      public Iterable<Line> getLines()
      Description copied from interface: Network
      Get all AC lines.
    • getBranch

      public Branch<?> getBranch(String branchId)
      Description copied from interface: Network
      Get a branch
      Parameters:
      branchId - the id of the branch
    • getBranches

      public Iterable<Branch> getBranches()
      Description copied from interface: Network
      Get all branches
    • getBranchStream

      public Stream<Branch> getBranchStream()
      Description copied from interface: Network
      Get all branches
    • getBranchCount

      public int getBranchCount()
      Description copied from interface: Network
      Get the branch count.
    • getLineStream

      public Stream<Line> getLineStream()
      Description copied from interface: Network
      Get all AC lines.
    • getLineCount

      public int getLineCount()
      Description copied from interface: Network
      Get the AC line count.
    • getLine

      public Line getLine(String id)
      Description copied from interface: Network
      Get a AC line.
      Parameters:
      id - the id or an alias of the AC line
    • newVoltageAngleLimit

      public VoltageAngleLimitAdder newVoltageAngleLimit()
      Description copied from interface: Network
      Get a builder to create a new VoltageAngleLimit.
    • getVoltageAngleLimits

      public Iterable<VoltageAngleLimit> getVoltageAngleLimits()
      Description copied from interface: Network
      Get all voltageAngleLimits.
    • getVoltageAngleLimitsStream

      public Stream<VoltageAngleLimit> getVoltageAngleLimitsStream()
      Description copied from interface: Network
      Get all voltageAngleLimits.
    • getVoltageAngleLimit

      public VoltageAngleLimit getVoltageAngleLimit(String id)
      Description copied from interface: Network
      Get voltage angle limit with id
    • newTieLine

      public TieLineAdder newTieLine()
      Description copied from interface: Network
      Get a builder to create a new AC tie line.
      Returns:
      a builder to create a new AC tie line
    • getTieLines

      public Iterable<TieLine> getTieLines()
      Description copied from interface: Network
      Get all tie lines.
    • getTieLineStream

      public Stream<TieLine> getTieLineStream()
      Description copied from interface: Network
      Get all tie lines.
    • getTieLineCount

      public int getTieLineCount()
      Description copied from interface: Network
      Get the tie line count.
    • getTieLine

      public TieLine getTieLine(String id)
      Description copied from interface: Network
      Get a tie line.
      Parameters:
      id - the id or an alias of the AC line
    • getTwoWindingsTransformers

      public Iterable<TwoWindingsTransformer> getTwoWindingsTransformers()
      Description copied from interface: Network
      Get all two windings transformers.
    • getTwoWindingsTransformerStream

      public Stream<TwoWindingsTransformer> getTwoWindingsTransformerStream()
      Description copied from interface: Network
      Get all two windings transformers.
    • getTwoWindingsTransformerCount

      public int getTwoWindingsTransformerCount()
      Description copied from interface: Network
      Get the two windings transformer count.
    • getTwoWindingsTransformer

      public TwoWindingsTransformer getTwoWindingsTransformer(String id)
      Description copied from interface: Network
      Get a two windings transformer.
      Parameters:
      id - the id or an alias of the two windings transformer
    • getThreeWindingsTransformers

      public Iterable<ThreeWindingsTransformer> getThreeWindingsTransformers()
      Description copied from interface: Network
      Get all 3 windings transformers.
    • getThreeWindingsTransformerStream

      public Stream<ThreeWindingsTransformer> getThreeWindingsTransformerStream()
      Description copied from interface: Network
      Get all 3 windings transformers.
    • getThreeWindingsTransformerCount

      public int getThreeWindingsTransformerCount()
      Description copied from interface: Network
      Get the 3 windings transformer count.
    • getThreeWindingsTransformer

      public ThreeWindingsTransformer getThreeWindingsTransformer(String id)
      Description copied from interface: Network
      Get a 3 windings transformer.
      Parameters:
      id - the id or an alias of the 3 windings transformer
    • getGenerators

      public Iterable<Generator> getGenerators()
      Description copied from interface: Network
      Get all generators.
    • getGeneratorStream

      public Stream<Generator> getGeneratorStream()
      Description copied from interface: Network
      Get all generators.
    • getGeneratorCount

      public int getGeneratorCount()
      Description copied from interface: Network
      Get the generator count.
    • getGenerator

      public Generator getGenerator(String id)
      Description copied from interface: Network
      Get a generator.
      Parameters:
      id - the id or an alias of the generator
    • getBatteries

      public Iterable<Battery> getBatteries()
      Description copied from interface: Network
      Get all batteries.
    • getBatteryStream

      public Stream<Battery> getBatteryStream()
      Description copied from interface: Network
      Get all batteries.
    • getBatteryCount

      public int getBatteryCount()
      Description copied from interface: Network
      Get the battery count.
    • getBattery

      public Battery getBattery(String id)
      Description copied from interface: Network
      Get a battery.
      Parameters:
      id - the id or an alias of the battery
    • getLoads

      public Iterable<Load> getLoads()
      Description copied from interface: Network
      Get all loads.
    • getLoadStream

      public Stream<Load> getLoadStream()
      Description copied from interface: Network
      Get all loads.
    • getLoadCount

      public int getLoadCount()
      Description copied from interface: Network
      Get the load count.
    • getLoad

      public Load getLoad(String id)
      Description copied from interface: Network
      Get a load.
      Parameters:
      id - the id or an alias of the load
    • getShuntCompensators

      public Iterable<ShuntCompensator> getShuntCompensators()
      Description copied from interface: Network
      Get all compensator shunts.
    • getShuntCompensatorStream

      public Stream<ShuntCompensator> getShuntCompensatorStream()
      Description copied from interface: Network
      Get all compensator shunts.
    • getShuntCompensatorCount

      public int getShuntCompensatorCount()
      Description copied from interface: Network
      Get the shunt count.
    • getShuntCompensator

      public ShuntCompensator getShuntCompensator(String id)
      Description copied from interface: Network
      Get a compensator shunt.
      Parameters:
      id - the id or an alias of the compensator shunt
    • getDanglingLines

      public Iterable<DanglingLine> getDanglingLines(DanglingLineFilter danglingLineFilter)
      Description copied from interface: Network
      Get all dangling lines corresponding to given filter.
    • getDanglingLineStream

      public Stream<DanglingLine> getDanglingLineStream(DanglingLineFilter danglingLineFilter)
      Description copied from interface: Network
      Get the dangling lines corresponding to given filter.
    • getDanglingLines

      public Iterable<DanglingLine> getDanglingLines()
      Description copied from interface: Network
      Get all dangling lines.
    • getDanglingLineStream

      public Stream<DanglingLine> getDanglingLineStream()
      Description copied from interface: Network
      Get all the dangling lines.
    • getDanglingLineCount

      public int getDanglingLineCount()
      Description copied from interface: Network
      Get the dangling line count.
    • getDanglingLine

      public DanglingLine getDanglingLine(String id)
      Description copied from interface: Network
      Get a dangling line.
      Parameters:
      id - the id or an alias of the dangling line
    • getStaticVarCompensators

      public Iterable<StaticVarCompensator> getStaticVarCompensators()
      Description copied from interface: Network
      Get all static var compensators.
    • getStaticVarCompensatorStream

      public Stream<StaticVarCompensator> getStaticVarCompensatorStream()
      Description copied from interface: Network
      Get all static var compensators.
    • getStaticVarCompensatorCount

      public int getStaticVarCompensatorCount()
      Description copied from interface: Network
      Get the static var compensator count.
    • getStaticVarCompensator

      public StaticVarCompensator getStaticVarCompensator(String id)
      Description copied from interface: Network
      Get a static var compensator.
      Parameters:
      id - the id or an alias of the static var compensator
    • getSwitch

      public Switch getSwitch(String id)
      Description copied from interface: Network
      Get a switch from its id or an alias.
      Parameters:
      id - id or an alias of the switch
      Returns:
      the switch
    • getSwitches

      public Iterable<Switch> getSwitches()
      Description copied from interface: Network
      Get all switches.
      Returns:
      all switches
    • getSwitchStream

      public Stream<Switch> getSwitchStream()
      Description copied from interface: Network
      Get all switches.
      Returns:
      all switches
    • getSwitchCount

      public int getSwitchCount()
      Description copied from interface: Network
      Get the switch count.
      Returns:
      the switch count
    • getBusbarSection

      public BusbarSection getBusbarSection(String id)
      Description copied from interface: Network
      Get a busbar section from its id or an alias.
      Parameters:
      id - the id or an alias of the busbar section
      Returns:
      the busbar section
    • getBusbarSections

      public Iterable<BusbarSection> getBusbarSections()
      Description copied from interface: Network
      Get all busbar sections.
      Returns:
      all busbar sections
    • getBusbarSectionStream

      public Stream<BusbarSection> getBusbarSectionStream()
      Description copied from interface: Network
      Get all busbar sections.
      Returns:
      all busbar sections
    • getBusbarSectionCount

      public int getBusbarSectionCount()
      Description copied from interface: Network
      Get the busbar section count.
      Returns:
      the busbar section count.
    • getHvdcConverterStations

      public Iterable<HvdcConverterStation<?>> getHvdcConverterStations()
      Description copied from interface: Network
      Get all HVDC converter stations.
      Returns:
      all HVDC converter stations
    • getHvdcConverterStationStream

      public Stream<HvdcConverterStation<?>> getHvdcConverterStationStream()
      Description copied from interface: Network
      Get all HVDC converter stations.
      Returns:
      all HVDC converter stations
    • getHvdcConverterStationCount

      public int getHvdcConverterStationCount()
      Description copied from interface: Network
      Get HVDC converter stations count.
      Returns:
      HVDC converter station count
    • getHvdcConverterStation

      public HvdcConverterStation<?> getHvdcConverterStation(String id)
      Description copied from interface: Network
      Get an HVDC converter station.
      Parameters:
      id - the id or an alias of the HVDC converter station
      Returns:
      the HVDC converter station or null if not found
    • getLccConverterStations

      public Iterable<LccConverterStation> getLccConverterStations()
      Description copied from interface: Network
      Get all LCC converter stations.
      Returns:
      all LCC converter stations
    • getLccConverterStationStream

      public Stream<LccConverterStation> getLccConverterStationStream()
      Description copied from interface: Network
      Get all LCC converter stations.
      Returns:
      all LCC converter stations
    • getLccConverterStationCount

      public int getLccConverterStationCount()
      Description copied from interface: Network
      Get LCC converter stations count.
      Returns:
      LCC converter station count
    • getLccConverterStation

      public LccConverterStation getLccConverterStation(String id)
      Description copied from interface: Network
      Get an LCC converter station.
      Parameters:
      id - the id or an alias of the LCC converter station
      Returns:
      the LCC converter station or null if not found
    • getVscConverterStations

      public Iterable<VscConverterStation> getVscConverterStations()
      Description copied from interface: Network
      Get all VSC converter stations.
      Returns:
      all VSC converter stations
    • getVscConverterStationStream

      public Stream<VscConverterStation> getVscConverterStationStream()
      Description copied from interface: Network
      Get all VSC converter stations.
      Returns:
      all VSC converter stations
    • getVscConverterStationCount

      public int getVscConverterStationCount()
      Description copied from interface: Network
      Get VSC converter stations count.
      Returns:
      VSC converter station count
    • getVscConverterStation

      public VscConverterStation getVscConverterStation(String id)
      Description copied from interface: Network
      Get an VSC converter station.
      Parameters:
      id - the id or an alias of the VSC converter station
      Returns:
      the VSC converter station or null if not found
    • getHvdcLines

      public Iterable<HvdcLine> getHvdcLines()
      Description copied from interface: Network
      Get all HVDC lines.
      Returns:
      all HVDC lines
    • getHvdcLineStream

      public Stream<HvdcLine> getHvdcLineStream()
      Description copied from interface: Network
      Get all HVDC lines.
      Returns:
      all HVDC lines
    • getHvdcLineCount

      public int getHvdcLineCount()
      Description copied from interface: Network
      Get HVDC lines count.
      Returns:
      HVDC lines count
    • getHvdcLine

      public HvdcLine getHvdcLine(String id)
      Description copied from interface: Network
      Get an HVDC line.
      Parameters:
      id - the id or an alias of the HVDC line
      Returns:
      the HVDC line or null if not found
    • getHvdcLine

      public HvdcLine getHvdcLine(HvdcConverterStation converterStation)
      Description copied from interface: Network
      Get an HVDC line from a converter station
      Parameters:
      converterStation - a HVDC converter station
      Returns:
      the HVDC line or null if not found
    • newHvdcLine

      public HvdcLineAdder newHvdcLine()
      Description copied from interface: Network
      Get a builder to create a new HVDC line.
      Returns:
      a builder to create a new HVDC line
    • getIdentifiable

      public Identifiable<?> getIdentifiable(String id)
      Description copied from interface: Network
      Get an equipment by its ID or alias
      Parameters:
      id - the id or an alias of the equipment
    • getIdentifiables

      public Collection<Identifiable<?>> getIdentifiables()
      Description copied from interface: Network
      Get all identifiables of the network.
      Returns:
      all identifiables of the network
    • getConnectables

      public <C extends Connectable> Iterable<C> getConnectables(Class<C> clazz)
      Description copied from interface: Network
      Get all connectables of the network for a given type
      Parameters:
      clazz - connectable type class
      Returns:
      all the connectables of the given type
    • getConnectableStream

      public <C extends Connectable> Stream<C> getConnectableStream(Class<C> clazz)
      Description copied from interface: Network
      Get a stream of all connectables of the network for a given type
      Parameters:
      clazz - connectable type class
      Returns:
      a stream of all the connectables of the given type
    • getConnectableCount

      public <C extends Connectable> int getConnectableCount(Class<C> clazz)
      Description copied from interface: Network
      Count the connectables of the network for a given type
      Parameters:
      clazz - connectable type class
      Returns:
      the count of all the connectables of the given type
    • getConnectables

      public Iterable<Connectable> getConnectables()
      Description copied from interface: Network
      Get all connectables of the network
      Returns:
      all the connectables
    • getConnectableStream

      public Stream<Connectable> getConnectableStream()
      Description copied from interface: Network
      Get a stream of all connectables of the network
      Returns:
      a stream of all the connectables
    • getConnectable

      public Connectable<?> getConnectable(String id)
      Description copied from interface: Network
      Get a connectable by its ID or alias
      Parameters:
      id - the id or an alias of the equipment
    • getConnectableCount

      public int getConnectableCount()
      Description copied from interface: Network
      Count the connectables of the network
      Returns:
      the count of all the connectables
    • getBusBreakerView

      public Network.BusBreakerView getBusBreakerView()
      Description copied from interface: Network
      Get a bus/breaker view of the network.
    • getBusView

      public Network.BusView getBusView()
      Description copied from interface: Network
      Get a bus view of the network.
    • createSubnetwork

      public Network createSubnetwork(String subnetworkId, String name, String sourceFormat)
      Create an empty subnetwork in the current network.

      This operation is not allowed on a subnetwork.

      This method throws an UnsupportedOperationException

      Parameters:
      subnetworkId - id of the subnetwork
      name - subnetwork's name
      sourceFormat - source format
      Returns:
      the created subnetwork
    • detach

      public Network detach()
      Description copied from interface: Network

      Detach the current network (including its subnetworks) from its parent network.

      Note that this operation is destructive: after it the current network's content couldn't be accessed from the parent network anymore.

      The boundary elements, i.e. linking this network to an external voltage level are split if possible.
      A PowsyblException is thrown if some un-splittable boundary elements are detected. This detection is processed before any network modification. So if an un-splittable boundary element is detected, no destructive operation will be done.

      Returns:
      a fully-independent network corresponding to the current network and its subnetworks.
    • isDetachable

      public boolean isDetachable()

      Check if the current network can be detached from its parent network (with Network.detach()).

      For now, only tie-lines can be split (HVDC lines may be supported later).

      Returns:
      True if the network can be detached from its parent network.
    • getBoundaryElements

      public Set<Identifiable<?>> getBoundaryElements()
      Description copied from interface: Network
      Return all the boundary elements of the current network, i.e. the elements which link or might link this network to an external voltage level.
      Returns:
      a set containing the boundary elements of the network.
    • isBoundaryElement

      public boolean isBoundaryElement(Identifiable<?> identifiable)
      Description copied from interface: Network
      Check if an identifiable is a boundary element for the current network.
      Parameters:
      identifiable - the identifiable to check
      Returns:
      True if the identifiable is a boundary element for the current network
    • addListener

      public void addListener(NetworkListener listener)

      Add a listener on the network.

      This method throws an PowsyblException.

      Motivation: The listeners apply to the whole network (root + subnetworks). Thus, in a network with several subnetworks, if calling addListener on a subnetwork registers the given listener on the root network, changes on another subnetwork will also be reported to the listener. This is counterintuitive and could lead to confusion. To avoid that, we don't allow to add or remove listeners from a subnetwork.

      Parameters:
      listener - the listener to add
    • removeListener

      public void removeListener(NetworkListener listener)

      Remove a listener from the network.

      This method throws an PowsyblException.

      Motivation: The listeners apply to the whole network (root + subnetworks). Thus, in a network with several subnetworks, if calling addListener on a subnetwork registers the given listener on the root network, changes on another subnetwork will also be reported to the listener. This is counterintuitive and could lead to confusion. To avoid that, we don't allow to add or remove listeners from a subnetwork.

      Parameters:
      listener - the listener to remove
    • runValidationChecks

      public ValidationLevel runValidationChecks()
      Description copied from interface: Network
      If network is valid, do nothing.
      If network not valid, check if each network component is valid. A ValidationException is thrown with an explicit message if one network component is not valid.
      If all network components are valid, network validation status is updated to true. Return the network validation status.
    • runValidationChecks

      public ValidationLevel runValidationChecks(boolean throwsException)
      Description copied from interface: Network
      If network is valid, do nothing.
      If network not valid and throwsException is true, check if each network component is valid. A ValidationException is thrown with an explicit message if one network component is not valid.
      If all network components are valid, network validation status is updated to true. Return the network validation status.
    • runValidationChecks

      public ValidationLevel runValidationChecks(boolean throwsException, Reporter reporter)
      Description copied from interface: Network
      If network is valid, do nothing.
      If network not valid and throwsException is true, check if each network component is valid. A ValidationException is thrown with an explicit message if one network component is not valid.
      If all network components are valid, network validation status is updated to true. Return the network validation status.
    • getValidationLevel

      public ValidationLevel getValidationLevel()
      Description copied from interface: Network
      Return the network validation status. Do not run any validation check.
    • setMinimumAcceptableValidationLevel

      public Network setMinimumAcceptableValidationLevel(ValidationLevel validationLevel)
    • getIdentifiableStream

      public Stream<Identifiable<?>> getIdentifiableStream(IdentifiableType identifiableType)
    • getContainerType

      public ContainerType getContainerType()
      Specified by:
      getContainerType in interface Container<Network>
    • getCaseDate

      public ZonedDateTime getCaseDate()
      Description copied from interface: Network
      Get the date that the network represents.
      Specified by:
      getCaseDate in interface Network
    • setCaseDate

      public Network setCaseDate(ZonedDateTime caseDate)
      Description copied from interface: Network
      Set the date that the network represents.
      Specified by:
      setCaseDate in interface Network
    • getForecastDistance

      public int getForecastDistance()
      Description copied from interface: Network
      Get the forecast distance in minutes.

      Example: 0 for a snapshot, 6*60 to 30*60 for a DACF.

      Specified by:
      getForecastDistance in interface Network
    • setForecastDistance

      public Network setForecastDistance(int forecastDistance)
      Specified by:
      setForecastDistance in interface Network
    • getSourceFormat

      public String getSourceFormat()
      Description copied from interface: Network
      Get the source format.
      Specified by:
      getSourceFormat in interface Network
      Returns:
      the source format
    • getTypeDescription

      protected String getTypeDescription()
    • transferExtensions

      protected static void transferExtensions(Network from, Network to)
      Transfer the extensions of a network to another one.
      Parameters:
      from - the network whose extensions must be transferred
      to - the destination network
    • getId

      public String getId()
      Description copied from interface: Identifiable
      Get the unique identifier of the object.
      Specified by:
      getId in interface Identifiable<I extends Identifiable<I>>
    • getOptionalName

      public Optional<String> getOptionalName()
      Description copied from interface: Identifiable
      Return an optional containing the name of the object if it exists. If not, return an empty optional.
      Specified by:
      getOptionalName in interface Identifiable<I extends Identifiable<I>>
    • getNameOrId

      public String getNameOrId()
      Description copied from interface: Identifiable
      Get the name of the object if it exists. If not, get the unique identifier of the object.
      Specified by:
      getNameOrId in interface Identifiable<I extends Identifiable<I>>
    • setName

      public Network setName(String name)
      Description copied from interface: Identifiable
      Update object name.
      Specified by:
      setName in interface Identifiable<I extends Identifiable<I>>
      Parameters:
      name - new name of the object (could be null to erase the name)
      Returns:
      the object itself
    • getAliases

      public Set<String> getAliases()
      Description copied from interface: Identifiable
      Get the aliases of the object.
      Specified by:
      getAliases in interface Identifiable<I extends Identifiable<I>>
    • getAliasType

      public Optional<String> getAliasType(String alias)
      Description copied from interface: Identifiable
      Get the alias type of an alias if it exists, an empty optional otherwise. If the alias does not exist, return an empty optional.
      Specified by:
      getAliasType in interface Identifiable<I extends Identifiable<I>>
    • getAliasFromType

      public Optional<String> getAliasFromType(String aliasType)
      Description copied from interface: Identifiable
      Get the alias of the object with a given alias type if it exists. Else return an empty optional.
      Specified by:
      getAliasFromType in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias)
      Description copied from interface: Identifiable
      Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. No alias type is associated to this alias. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw a PowsyblException
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias, boolean ensureAliasUnicity)
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias, String aliasType)
      Description copied from interface: Identifiable
      Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. This alias is associated to a given alias type. If the given alias type is null or empty, no alias type is considered associated to the alias. Only one alias can be associated to a non null given alias type for one object. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw a PowsyblException If a given non null type already has an associated alias for this object, throw a PowsyblException
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias, String aliasType, boolean ensureAliasUnicity)
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • removeAlias

      public void removeAlias(String alias)
      Description copied from interface: Identifiable
      Remove an alias of the object. If the alias does not exist for this object, throw a PowsyblException
      Specified by:
      removeAlias in interface Identifiable<I extends Identifiable<I>>
    • hasAliases

      public boolean hasAliases()
      Description copied from interface: Identifiable
      Return true if identifiable has aliases.
      Specified by:
      hasAliases in interface Identifiable<I extends Identifiable<I>>
    • isFictitious

      public boolean isFictitious()
      Description copied from interface: Identifiable
      Get the fictitious status
      Specified by:
      isFictitious in interface Identifiable<I extends Identifiable<I>>
    • setFictitious

      public void setFictitious(boolean fictitious)
      Description copied from interface: Identifiable
      Set the fictitious status
      Specified by:
      setFictitious in interface Identifiable<I extends Identifiable<I>>
    • getMessageHeader

      public String getMessageHeader()
      Specified by:
      getMessageHeader in interface Validable
    • getProperties

      public Properties getProperties()
    • hasProperty

      public boolean hasProperty()
      Description copied from interface: Identifiable
      Check that this object has some properties.
      Specified by:
      hasProperty in interface Identifiable<I extends Identifiable<I>>
    • hasProperty

      public boolean hasProperty(String key)
      Description copied from interface: Identifiable
      Check that this object has property with specified name.
      Specified by:
      hasProperty in interface Identifiable<I extends Identifiable<I>>
    • getProperty

      public String getProperty(String key)
      Description copied from interface: Identifiable
      Get property associated to specified key.
      Specified by:
      getProperty in interface Identifiable<I extends Identifiable<I>>
    • getProperty

      public String getProperty(String key, String defaultValue)
      Description copied from interface: Identifiable
      Get property associated to specified key, with default value.
      Specified by:
      getProperty in interface Identifiable<I extends Identifiable<I>>
    • setProperty

      public String setProperty(String key, String value)
      Description copied from interface: Identifiable
      Set property value associated to specified key.
      Specified by:
      setProperty in interface Identifiable<I extends Identifiable<I>>
    • removeProperty

      public boolean removeProperty(String key)
      Description copied from interface: Identifiable
      Remove property with specified key.
      Specified by:
      removeProperty in interface Identifiable<I extends Identifiable<I>>
      Parameters:
      key - the property key
      Returns:
      true if property exists and has been removed, false otherwise
    • getPropertyNames

      public Set<String> getPropertyNames()
      Description copied from interface: Identifiable
      Get properties key values.
      Specified by:
      getPropertyNames in interface Identifiable<I extends Identifiable<I>>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • extendVariantArraySize

      public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex)
      Description copied from interface: MultiVariantObject
      Called to extend the variant array.
      Specified by:
      extendVariantArraySize in interface MultiVariantObject
      Parameters:
      initVariantArraySize - initial variant array size
      number - number of element to add
      sourceIndex - the variant index to use to initialize new variants
    • reduceVariantArraySize

      public void reduceVariantArraySize(int number)
      Description copied from interface: MultiVariantObject
      Called to reduce the variant array.
      Specified by:
      reduceVariantArraySize in interface MultiVariantObject
      Parameters:
      number - number of element to remove
    • deleteVariantArrayElement

      public void deleteVariantArrayElement(int index)
      Description copied from interface: MultiVariantObject
      Called to delete a variant array element.
      Specified by:
      deleteVariantArrayElement in interface MultiVariantObject
      Parameters:
      index - the index of the variant array to delete
    • allocateVariantArrayElement

      public void allocateVariantArrayElement(int[] indexes, int sourceIndex)
      Description copied from interface: MultiVariantObject
      Called to allocate a variant array element. All new variants will be initialize using values of the variant sourceIndex.
      Specified by:
      allocateVariantArrayElement in interface MultiVariantObject
      Parameters:
      indexes - the indexes of the variant array to allocate
      sourceIndex - the variant index to use to initialize new variants