Skip to content

clsTranslationResult

Carries the outcome of a translation or lookup operation as a single object so callers can return the translated value, how trustworthy that value is, and any explanatory message together.

Purpose

  • Package a translation result value with confidence and message metadata.
  • Let callers distinguish exact matches, probable matches, defaults, and failures through the nested accuracy enum.
  • Provide a simple display string by returning the message text from ToString().

Context

  • Namespace: SAIF.Business.Policy
  • Assembly/package: SAIF.Business.Policy

Public members

Member Signature Purpose
Result Public Property Result() As Object Holds the translated payload returned by the caller's translation logic.
Accuracy Public Property Accuracy() As Accuracies Records how closely the result matches the caller's requested translation.
Message Public Property Message() As String Carries explanatory or user-facing text associated with the translation result.
ToString Public Overrides Function ToString() As String Returns the message text for quick display or logging.
New Public Sub New() Creates an empty result that defaults to Failure accuracy and blank message text.
New Public Sub New(ByVal inResult As Object, ByVal inAccuracy As Accuracies, Optional ByVal inMessage As String = "") Creates a fully populated translation result in one call.

Nested types

Accuracies

Accuracies describes how reliable the translation result is.

Member Meaning
ExactMatch = 100 The translation resolved the requested value exactly.
MostLikely = 75 The translation returned the best likely match rather than a confirmed exact match.
Default = 10 The translation fell back to a default value.
Failure = 0 The translation did not produce a usable result.

Behavioral notes

  • Property setters avoid reassigning the backing field when the incoming value matches the current value.
  • A default-constructed instance starts with Accuracy = Failure and Message = String.Empty.

Constraints and usage notes

  • Result is typed as Object, so callers must agree on the payload type outside this contract.
  • Consumers that display the object directly will see Message, not Result.

Sources

  • SAIF.Business.Policy\clsTranslationResult.vb