Class SingleTranslationQuery

java.lang.Object
com.e1c.langtool.query.TranslationQuery
com.e1c.langtool.query.SingleTranslationQuery
All Implemented Interfaces:
ISingleTranslationQuery

public final class SingleTranslationQuery extends TranslationQuery implements ISingleTranslationQuery
Encapsulates a translation query for single text.

SingleTranslationQuery is an immutable and thread-safe class.

See Also:
  • ITranslationQuery
  • Method Details

    • createQuery

      public static ISingleTranslationQuery createQuery(String text, String sourceLocale, String targetLocale, boolean isProcessing)
      Creates a new translation query for single text.
      Parameters:
      text - the text to translate
      sourceLocale - the source language of text
      targetLocale - the target language to translate
      isProcessing - information text processing is needed or not
      Returns:
      a new translation query for single text
      Throws:
      IllegalArgumentException - if the value of any argument is null
    • createQuery

      public static ISingleTranslationQuery createQuery(String text, String sourceLocale, String targetLocale)
      Creates a new translation query with processing for single text.
      Parameters:
      text - the text to translate
      sourceLocale - the source language of text
      targetLocale - the target language to translate
      Returns:
      a new translation query for single text
      Throws:
      IllegalArgumentException - if the value of any argument is null
    • getText

      public String getText()
      Description copied from interface: ISingleTranslationQuery
      Returns the text to translate.
      Specified by:
      getText in interface ISingleTranslationQuery
      Returns:
      the text to translate. Can't be null.
    • hashCode

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

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

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

      String getSourceLanguage()
      Returns the code of source language of text.
      Returns:
      the code of source language. Can't be null.
    • getTargetLanguage

      String getTargetLanguage()
      Returns the code of target language to translate.
      Returns:
      the code of target language to translate. Can't be null.
    • isProcessingNeeded

      boolean isProcessingNeeded()
      Returns true if the text (or texts) needs of processing.
      Returns:
      true if the text (or texts) needs of processing