Class ConstantHasText

java.lang.Object
com.helger.commons.text.AbstractHasText
com.helger.commons.text.ConstantHasText
All Implemented Interfaces:
IHasText

@Immutable @MustImplementEqualsAndHashcode public class ConstantHasText extends AbstractHasText
An implementation of the IHasText interface that always returns a constant string. Use this only for texts that never need to be translated!
Author:
Philip Helger
  • Constructor Details

    • ConstantHasText

      public ConstantHasText(@Nonnull String sFixedText)
  • Method Details

    • internalGetText

      @Nullable protected String internalGetText(@Nonnull Locale aContentLocale)
      Description copied from class: AbstractHasText
      Main text resolving. Get the text in the passed locale.
      Specified by:
      internalGetText in class AbstractHasText
      Parameters:
      aContentLocale - Locale to use. This is the locale resolved internally. Never null.
      Returns:
      null if no such text present in the passed locale
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object