0

How can I add the string value of the property (from a User-instance) within the message format?

// I want to access a property from the user and put it into the message
@Message(value = "the user: {user.id} - {user.name}", format = Message.Format.MESSAGE_FORMAT)
void test(User user);

How can I do that?

nimo23
  • 5,170
  • 10
  • 46
  • 75

1 Answers1

1

Expressions like that are not currently supported. You'd need to do it manually with something like:

@Message(value = "the user: {0} - {1}", format = Message.Format.MESSAGE_FORMAT)
void test(String id, String name);
James R. Perkins
  • 16,800
  • 44
  • 60