/** * Creates a new {@code Blip} object used for this session. A temporary * id will be assigned to the newly created {@code Blip} object. * * @param wavelet the wavelet that owns this blip. * @param initialContent the initial content of the new blip. * @param parentBlipId the parent of this blip. * @return an instance of new {@code Blip} object used for this session. */ private static Blip newBlip(Wavelet wavelet, String initialContent, String parentBlipId, String blipId, String threadId) { Blip newBlip = new Blip(blipId, initialContent, parentBlipId, threadId, wavelet); if (parentBlipId != null) { Blip parentBlip = wavelet.getBlips().get(parentBlipId); if (parentBlip != null) { parentBlip.getChildBlipIds().add(newBlip.getBlipId()); } } wavelet.getBlips().put(newBlip.getBlipId(), newBlip); BlipThread thread = wavelet.getThread(threadId); if (thread != null) { thread.appendBlip(newBlip); } return newBlip; }