class DefaultLocalNode implements MutableLocalNode {

  @Override
  public void setEnode(final EnodeURL enode) throws NodeAlreadySetException {
    if (peer.isPresent()) {
      throw new NodeAlreadySetException("Attempt to set already initialized local node");
    }
    this.peerInfo =
        Optional.of(
            new PeerInfo(
                p2pVersion,
                clientId,
                supportedCapabilities,
                enode.getListeningPortOrZero(),
                enode.getNodeId()));
    this.peer = Optional.of(DefaultPeer.fromEnodeURL(enode));
    isReady.set(true);
  }

  private  DefaultLocalNode(
      final String clientId, final int p2pVersion, final List<Capability> supportedCapabilities);

}