BibEntry. This allows to have an AI chat even if the entry does not have a citation key or it is not unique.
At the close of JabRef the chats are flushed to the on-disk storage (ChatHistoryRepository).
| Modifier and Type | Class and Description |
|---|---|
| private static record | |
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Map | |
| private static final Logger | |
| private final ChatHistoryRepository |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| private void | flushChat(boolean entityExists, ChatIdentifier currentIdentifier, String originalName, String currentName, ObservableList<ChatMessage> chatHistory, String entityType)
Generic flush logic for both entry and group chats |
| private void | |
| private void | |
| public synchronized ObservableList | Returns: the live, mutable chat historythe database context for the entry (needed for persistence) databaseContext, BibEntry the entry to get chat history for entry)Returns the chat history for |
| public synchronized ObservableList | Returns: the live, mutable chat historythe database context for the group (needed for persistence) databaseContext, GroupTreeNode the group to get chat history for group)Returns the chat history for |
| public synchronized void | |
| public synchronized void |
| entryChats | back to summary |
|---|---|
| private final Map<BibEntry, InMemoryChatHistoryCache. | |
| groupChats | back to summary |
|---|---|
| private final Map<GroupTreeNode, InMemoryChatHistoryCache. | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| repository | back to summary |
|---|---|
| private final ChatHistoryRepository repository | |
| InMemoryChatHistoryCache | back to summary |
|---|---|
| public InMemoryChatHistoryCache(ChatHistoryRepository repository) | |
| close | back to summary |
|---|---|
| public synchronized void close() | |
| flushChat | back to summary |
|---|---|
| private void flushChat(boolean entityExists, ChatIdentifier currentIdentifier, String originalName, String currentName, ObservableList<ChatMessage> chatHistory, String entityType) Generic flush logic for both entry and group chats | |
| flushEntryChat | back to summary |
|---|---|
| private void flushEntryChat(BibEntry entry, InMemoryChatHistoryCache. | |
| flushGroupChat | back to summary |
|---|---|
| private void flushGroupChat(GroupTreeNode group, InMemoryChatHistoryCache. | |
| getForEntry | back to summary |
|---|---|
| public synchronized ObservableList Returns the chat history for
| |
| getForGroup | back to summary |
|---|---|
| public synchronized ObservableList Returns the chat history for
| |
| removeEntry | back to summary |
|---|---|
| public synchronized void removeEntry(BibEntry entry) Removes the cached chat history for an entry. The chat history is NOT persisted before removal - it's simply discarded from RAM. | |
| removeGroup | back to summary |
|---|---|
| public synchronized void removeGroup(GroupTreeNode group) Removes the cached chat history for a group. The chat history is NOT persisted before removal - it's simply discarded from RAM. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ObservableList | chatHistory
Record Component accessed by chatHistory(). |
| private final BibDatabaseContext | databaseContext
Record Component accessed by databaseContext(). |
| private final Optional | originalCitationKey
Record Component accessed by originalCitationKey(). |
| Access | Constructor and Description |
|---|---|
| private | CachedEntryChat(BibDatabaseContext databaseContext, Optional<String> originalCitationKey, ObservableList<ChatMessage> chatHistory)
|
| Modifier and Type | Method and Description |
|---|---|
| public ObservableList | |
| public BibDatabaseContext | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public Optional | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| chatHistory | back to summary |
|---|---|
| private final ObservableList<ChatMessage> chatHistory Record Component accessed by chatHistory(). | |
| databaseContext | back to summary |
|---|---|
| private final BibDatabaseContext databaseContext Record Component accessed by databaseContext(). | |
| originalCitationKey | back to summary |
|---|---|
| private final Optional<String> originalCitationKey Record Component accessed by originalCitationKey(). | |
| CachedEntryChat | back to summary |
|---|---|
| private CachedEntryChat(BibDatabaseContext databaseContext, Optional<String> originalCitationKey, ObservableList<ChatMessage> chatHistory) | |
| chatHistory | back to summary |
|---|---|
| public ObservableList Record Component getter of chatHistory. | |
| databaseContext | back to summary |
|---|---|
| public BibDatabaseContext databaseContext() Record Component getter of databaseContext. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| originalCitationKey | back to summary |
|---|---|
| public Optional Record Component getter of originalCitationKey. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ObservableList | chatHistory
Record Component accessed by chatHistory(). |
| private final BibDatabaseContext | databaseContext
Record Component accessed by databaseContext(). |
| private final GroupTreeNode | |
| private final String | originalGroupName
Record Component accessed by originalGroupName(). |
| Access | Constructor and Description |
|---|---|
| private | CachedGroupChat(BibDatabaseContext databaseContext, String originalGroupName, GroupTreeNode group, ObservableList<ChatMessage> chatHistory)
|
| Modifier and Type | Method and Description |
|---|---|
| public ObservableList | |
| public BibDatabaseContext | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public GroupTreeNode | |
| public final int | |
| public String | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| chatHistory | back to summary |
|---|---|
| private final ObservableList<ChatMessage> chatHistory Record Component accessed by chatHistory(). | |
| databaseContext | back to summary |
|---|---|
| private final BibDatabaseContext databaseContext Record Component accessed by databaseContext(). | |
| group | back to summary |
|---|---|
| private final GroupTreeNode group Record Component accessed by group(). | |
| originalGroupName | back to summary |
|---|---|
| private final String originalGroupName Record Component accessed by originalGroupName(). | |
| CachedGroupChat | back to summary |
|---|---|
| private CachedGroupChat(BibDatabaseContext databaseContext, String originalGroupName, GroupTreeNode group, ObservableList<ChatMessage> chatHistory) | |
| chatHistory | back to summary |
|---|---|
| public ObservableList Record Component getter of chatHistory. | |
| databaseContext | back to summary |
|---|---|
| public BibDatabaseContext databaseContext() Record Component getter of databaseContext. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| group | back to summary |
|---|---|
| public GroupTreeNode group() Record Component getter of group. | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| originalGroupName | back to summary |
|---|---|
| public String originalGroupName() Record Component getter of originalGroupName. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |