Package dk.cloudcreate.essentials.shared
Class MessageFormatter.NamedArgumentBinding
- java.lang.Object
-
- dk.cloudcreate.essentials.shared.MessageFormatter.NamedArgumentBinding
-
- Enclosing class:
- MessageFormatter
public static class MessageFormatter.NamedArgumentBinding extends Object
Named argument binding instance
-
-
Constructor Summary
Constructors Constructor Description NamedArgumentBinding(String name, Object value)Create a new Named argument binding
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageFormatter.NamedArgumentBindingarg(String name, Object value)Create a named argument binding:StringtoString()
-
-
-
Constructor Detail
-
NamedArgumentBinding
public NamedArgumentBinding(String name, Object value)
Create a new Named argument binding
bind("Hello {:firstName}", new NamedArgumentBinding("firstName", "Peter"))will return"Hello Peter"- Parameters:
name- The name of the argumentvalue- the value that will be inserted where ever an argument with name matchingnameis placed
-
-
Method Detail
-
arg
public static MessageFormatter.NamedArgumentBinding arg(String name, Object value)
Create a named argument binding:bind("Hello {:firstName} {:lastName}.", arg("firstName", "Peter"), arg("lastName", "Hansen"))will return"Hello Peter Hansen."- Parameters:
name- The name of the argumentvalue- the value that will be inserted where ever an argument with name matchingnameis placed- Returns:
- a
MessageFormatter.NamedArgumentBindinginstance
-
-