protected CreatePhysicalPortCommand(EnniPort port) {
      setNmsPortId(port.getNmsPortId());
      setNocLabel(port.getNocLabel());
      setBodPortId(port.getBodPortId());

      this.inboundPeer = port.getInboundPeer().orElse(null);
      this.outboundPeer = port.getOutboundPeer().orElse(null);
      this.allowedVlan = port.getAllowedVlan().map(Vlan::toRangeString).orElse("");
      this.sVlan = port.getSVlan().orElse(null);

      setTopologyName(port.getTopologyName());
    }
  private EnniPort createEnniPort(CreatePhysicalPortCommand command, NbiPort nbiPort) {
    EnniPort enniPort = new EnniPort(nbiPort);

    enniPort.setNocLabel(command.getNocLabel());
    enniPort.setBodPortId(command.getBodPortId());
    if (enniPort.isVlanRequired()) {
      enniPort.setAllowedVlan(Optional.of(Vlan.parse(command.getAllowedVlan())));
      enniPort.setSVlan(Optional.ofNullable(command.getSVlan()));
    }
    enniPort.setInboundPeer(
        Optional.ofNullable(command.getInboundPeer())
            .map(String::trim)
            .filter(StringUtils::isNotEmpty));
    enniPort.setOutboundPeer(
        Optional.ofNullable(command.getOutboundPeer())
            .map(String::trim)
            .filter(StringUtils::isNotEmpty));
    enniPort.setTopologyName(command.getTopologyName());
    return enniPort;
  }
 public UpdatePhysicalPortCommand(EnniPort enniPort) {
   super(enniPort);
   this.version = enniPort.getVersion();
   this.id = enniPort.getId();
 }