Class TranslationResultImpl
java.lang.Object
com.adobe.granite.translation.core.common.TranslationResultImpl
- All Implemented Interfaces:
TranslationResult
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTranslationResultImpl(String translation, String sourceLang, String targetLang, TranslationConstants.ContentType contentType, String category, String source, int rating, String userId) -
Method Summary
Modifier and TypeMethodDescriptionGets the category.Gets the content type.intGets the rating.Gets the source language.Gets the source string.Gets the target language.Gets the translation.Gets the user id.
-
Field Details
-
UNKNOWN_RATING
public static int UNKNOWN_RATING
-
-
Constructor Details
-
TranslationResultImpl
-
-
Method Details
-
getTranslation
Description copied from interface:TranslationResultGets the translation.- Specified by:
getTranslationin interfaceTranslationResult- Returns:
- The translation response from the Machine Translation engine
-
getSourceLanguage
Description copied from interface:TranslationResultGets the source language.- Specified by:
getSourceLanguagein interfaceTranslationResult- Returns:
- The original source language. If this was not specified during the translation call it is determined by leveraging the Translation Detection functionality
-
getTargetLanguage
Description copied from interface:TranslationResultGets the target language.- Specified by:
getTargetLanguagein interfaceTranslationResult- Returns:
- The target language. If this was not specified during the translation call it may be determined based on the Resource path, Resource locale, or locale of the user.
-
getContentType
Description copied from interface:TranslationResultGets the content type.- Specified by:
getContentTypein interfaceTranslationResult- Returns:
- The content type of the Source String and the Target String it was translated into.
-
getCategory
Description copied from interface:TranslationResultGets the category.- Specified by:
getCategoryin interfaceTranslationResult- Returns:
- The content category. If this was not specified during the translation call it is defaulted to "general"
-
getSourceString
Description copied from interface:TranslationResultGets the source string.- Specified by:
getSourceStringin interfaceTranslationResult- Returns:
- The original source String that was translated.
-
getRating
public int getRating()Description copied from interface:TranslationResultGets the rating.- Specified by:
getRatingin interfaceTranslationResult- Returns:
- The rating of the returned translation. If unknown this will return -999.
-
getUserId
Description copied from interface:TranslationResultGets the user id.- Specified by:
getUserIdin interfaceTranslationResult- Returns:
- The ID corresponding to the user who edited the current translation. This might be the user who is currently editing a translation (@see TranslationService.storeTranslation) or the user who edited the currently returned translation (@see TranslationService.translateString). This field might be blank or null depending on the availability of this data.
-