Class I18nedMessage

java.lang.Object
de.odrotbohm.spring.web.model.I18nedMessage
All Implemented Interfaces:
org.springframework.context.MessageSourceResolvable

public class I18nedMessage extends Object implements org.springframework.context.MessageSourceResolvable
Simple implementation of MessageSourceResolvable to trigger translation of the given code(s). Useful, to e.g. translate texts within ErrorsWithDetails.
Author:
Oliver Drotbohm, Jens Kutzsche
See Also:
  • Constructor Details

    • I18nedMessage

      public I18nedMessage()
  • Method Details

    • of

      public static I18nedMessage of(String code, String... additionalCodes)
      Creates a new I18nedMessage for the given codes.
      Parameters:
      code - the primary code to resolve.
      additionalCodes - additional codes to be used for lookup.
      Returns:
      will never be null.
    • withArguments

      public I18nedMessage withArguments(Object... arguments)