Class SynonymItem

java.lang.Object
org.codelibs.fess.dict.DictionaryItem
org.codelibs.fess.dict.synonym.SynonymItem

public class SynonymItem extends DictionaryItem
Represents an item in a synonym dictionary. This class stores a set of input words and their corresponding output synonyms. It also tracks updated values for the item.
  • Constructor Details

    • SynonymItem

      public SynonymItem(long id, String[] inputs, String[] outputs)
      Constructs a new synonym item.
      Parameters:
      id - The unique identifier of the item.
      inputs - The input words.
      outputs - The output synonyms.
  • Method Details

    • getNewInputs

      public String[] getNewInputs()
      Gets the new input words. Returns a defensive copy to prevent external modification.
      Returns:
      The new input words (defensive copy).
    • setNewInputs

      public void setNewInputs(String[] newInputs)
      Sets the new input words.
      Parameters:
      newInputs - The new input words.
    • getNewOutputs

      public String[] getNewOutputs()
      Gets the new output synonyms. Returns a defensive copy to prevent external modification.
      Returns:
      The new output synonyms (defensive copy).
    • setNewOutputs

      public void setNewOutputs(String[] newOutputs)
      Sets the new output synonyms.
      Parameters:
      newOutputs - The new output synonyms.
    • getInputs

      public String[] getInputs()
      Gets the original input words. Returns a defensive copy to prevent external modification.
      Returns:
      The original input words (defensive copy).
    • getInputsValue

      public String getInputsValue()
      Gets the input words as a newline-separated string.
      Returns:
      The input words as a string.
    • getOutputs

      public String[] getOutputs()
      Gets the original output synonyms. Returns a defensive copy to prevent external modification.
      Returns:
      The original output synonyms (defensive copy).
    • getOutputsValue

      public String getOutputsValue()
      Gets the output synonyms as a newline-separated string.
      Returns:
      The output synonyms as a string.
    • isUpdated

      public boolean isUpdated()
      Checks if the item has been updated.
      Returns:
      true if the item has been updated, false otherwise.
    • isDeleted

      public boolean isDeleted()
      Checks if the item has been marked for deletion.
      Returns:
      true if the item is marked for deletion, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toLineString

      public String toLineString()
      Converts the item to a string representation for writing to a file.
      Returns:
      A string in the format "input1,input2=>output1,output2".