Interface LocalizedString


public interface LocalizedString

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.


Example to create an instance using the builder pattern

     LocalizedString localizedString = LocalizedString.builder()
             ./^[a-z]{2}(-[A-Z]{2})?$/("{/^[a-z]{2}(-[A-Z]{2})?$/}")
             .build()
 
  • Method Details

    • values

      @NotNull @NotNull Map<String,String> values()

      String used for the specified language.

      Returns:
      map of the pattern property values
    • setValue

      void setValue(String key, String value)

      String used for the specified language.

      Parameters:
      key - property name
      value - property value
    • of

      static LocalizedString of()
      factory method
      Returns:
      instance of LocalizedString
    • of

      static LocalizedString of(LocalizedString template)
      factory method to create a shallow copy LocalizedString
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      LocalizedString copyDeep()
    • deepCopy

      @Nullable static LocalizedString deepCopy(@Nullable LocalizedString template)
      factory method to create a deep copy of LocalizedString
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static LocalizedStringBuilder builder()
      builder factory method for LocalizedString
      Returns:
      builder
    • builder

      static LocalizedStringBuilder builder(LocalizedString template)
      create builder for LocalizedString instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withLocalizedString

      default <T> T withLocalizedString(Function<LocalizedString,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<LocalizedString> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference