Class LocalizedString.ExpressionAlternative

java.lang.Object
com.lokalized.LocalizedString.ExpressionAlternative
Enclosing class:
LocalizedString

@Immutable public static final class LocalizedString.ExpressionAlternative extends Object
An expression and the generated fragment translation selected when that expression matches.
Since:
3.0.0
Author:
Mark Allen
  • Constructor Details

    • ExpressionAlternative

      public ExpressionAlternative(@NonNull String expression, @NonNull String translation)
      Constructs an expression-driven fragment alternative.
      Parameters:
      expression - the localization expression, not null
      translation - the fragment translation, not null
  • Method Details

    • toString

      Generates a String representation of this object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this object, not null
    • equals

      public boolean equals(@Nullable Object other)
      Checks if this object is equal to another one.
      Overrides:
      equals in class Object
      Parameters:
      other - the object to check, null returns false
      Returns:
      true if this is equal to the other object, false otherwise
    • hashCode

      public int hashCode()
      A hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      a suitable hash code
    • getExpression

      Gets the localization expression.
      Returns:
      the localization expression, not null
    • getTranslation

      Gets the fragment translation selected when this expression matches.
      Returns:
      the fragment translation, not null