TerminalExt build() { String connectionBus = getConnectionBus(); if (node != null && connectionBus != null) { throw new ValidationException(validable, "connection node and connection bus are exclusives"); } if (node == null) { if (connectionBus == null) { throw new ValidationException(validable, "connectable bus is not set"); } return new BusTerminal(network, connectionBus, bus != null); } else { return new NodeTerminal(network, node); } }
@Override public BusbarSection add() { String id = checkAndGetUniqueId(); TerminalExt terminal = new NodeTerminal(getNetwork().getRef(), node); BusbarSectionImpl section = new BusbarSectionImpl(id, getName()); section.addTerminal(terminal); voltageLevel.attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(section); getNetwork().getListeners().notifyCreation(section); return section; }