/** * Creates a conversation thread backed by a manifest thread and inserts it in * {@code replies}. */ private WaveletBasedConversationThread adaptThread(ObservableManifestThread manifestThread) { WaveletBasedConversationThread thread = WaveletBasedConversationThread.create(manifestThread, this, helper); String id = thread.getId(); replies.put(id, thread); return thread; }
/** * Constructs a new conversation backed by a wavelet. */ WaveletBasedConversation(WaveBasedConversationView wave, ObservableWavelet wavelet, ObservableManifest manifest, IdGenerator idGenerator) { Preconditions.checkNotNull(wavelet, "Null wavelet"); Preconditions.checkNotNull(manifest, "Null conversation manifest"); this.wave = wave; this.wavelet = wavelet; this.manifest = manifest; this.idGenerator = idGenerator; try { this.rootThread = WaveletBasedConversationThread.create(manifest.getRootThread(), null, new ComponentHelper()); } catch (RuntimeException e) { throw new IllegalArgumentException("Failed to create conversation on wavelet " + wavelet.getWaveId() + " " + wavelet.getId(), e); } }