Package io.micronaut.http.server.binding
Class LocaleArgumentBinder
java.lang.Object
io.micronaut.http.server.binding.LocaleArgumentBinder
- All Implemented Interfaces:
 ArgumentBinder<Locale,,HttpRequest<?>> TypeArgumentBinder<Locale,,HttpRequest<?>> RequestArgumentBinder<Locale>,TypedRequestArgumentBinder<Locale>
@Singleton
public class LocaleArgumentBinder
extends Object
implements TypedRequestArgumentBinder<Locale>
Binds 
Locale arguments in controller methods using
 the LocaleResolver.- Since:
 - 2.3.0
 - Author:
 - James Kleeh
 
- 
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
ArgumentBinder.BindingResult<T> - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbind(ArgumentConversionContext<Locale> context, HttpRequest<?> source) Bind the given argument from the given source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.bind.binders.RequestArgumentBinder
createSpecificMethods inherited from interface io.micronaut.http.bind.binders.TypedRequestArgumentBinder
matches, superTypes 
- 
Constructor Details
- 
LocaleArgumentBinder
- Parameters:
 localeResolver- The locale resolver
 
 - 
 - 
Method Details
- 
argumentType
- Specified by:
 argumentTypein interfaceTypeArgumentBinder<Locale,HttpRequest<?>> - Returns:
 - The argument type.
 
 - 
bind
public ArgumentBinder.BindingResult<Locale> bind(ArgumentConversionContext<Locale> context, HttpRequest<?> source) Description copied from interface:ArgumentBinderBind the given argument from the given source.- Specified by:
 bindin interfaceArgumentBinder<Locale,HttpRequest<?>> - Parameters:
 context- TheArgumentConversionContextsource- The source- Returns:
 - An 
Optionalof the value. If no binding was possibleOptional.empty() 
 
 -