Package org.springframework.validation

# Interface MessageCodeFormatter

All Known Implementing Classes:
  `DefaultMessageCodesResolver.Format`

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MessageCodeFormatter
A strategy interface for formatting message codes.

Since:
  3.2
Author:
  Chris Beams
See Also:
  - `DefaultMessageCodesResolver`
  - `DefaultMessageCodesResolver.Format`

## Method Summary

Modifier and Type
Method
Description
`String`
`format(String errorCode, String objectName, String field)`
Build and return a message code consisting of the given fields, usually delimited by `DefaultMessageCodesResolver.CODE_SEPARATOR`.

## Method Details

### format

String format(String errorCode, @Nullable String objectName, @Nullable String field)
Build and return a message code consisting of the given fields, usually delimited by `DefaultMessageCodesResolver.CODE_SEPARATOR`.

Parameters:
  `errorCode` - for example: "typeMismatch"
  `objectName` - for example: "user"
  `field` - for example, "age"
Returns:
  concatenated message code, for example: "typeMismatch.user.age"
See Also:
  - `DefaultMessageCodesResolver.Format`