/** * Checks that a conversation is accessible by examining some state. */ protected static void assertConversationAccessible(Conversation conversation) { conversation.getAnchor(); assertThreadAccessible(conversation.getRootThread()); }
/** * Checks that a conversation is accessible by examining some state. */ protected static void assertConversationAccessible(Conversation conversation) { conversation.getAnchor(); assertThreadAccessible(conversation.getRootThread()); }
/** @return the structure of a conversations in {@code wave}. */ public static ConversationStructure of(ConversationView wave) { IdentityMap<ConversationBlip, Collection<Conversation>> anchoring = null; Collection<Conversation> unanchored = null; Conversation mainConversation = getMainConversation(wave); for (Conversation conversation : wave.getConversations()) { if (conversation == mainConversation) { continue; } Anchor anchor = conversation.getAnchor(); ConversationBlip blip = anchor != null ? anchor.getBlip() : null; if (blip != null) { addLazily((anchoring = createIfNull(anchoring)), blip, conversation); } else { (unanchored = createIfNull(unanchored)).add(conversation); } } if (anchoring == null) { anchoring = CollectionUtils.emptyIdentityMap(); } if (unanchored == null) { unanchored = Collections.emptySet(); } return new ConversationStructure(anchoring, unanchored, mainConversation); }