Class SessionLocaleUtils
java.lang.Object
de.codecamp.messages.spring.vaadin.SessionLocaleUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocaleReturns the locale of the current session.static LocalegetSessionLocale(com.vaadin.flow.server.VaadinSession session) Returns the locale of the given session.static TimeZoneReturns the time zone of the current session.static TimeZonegetSessionTimeZone(com.vaadin.flow.server.VaadinSession session) Returns the time zone of the given session.static voidsetSessionLocale(com.vaadin.flow.server.VaadinSession session, Locale locale) Updates the locale of the given session.static voidsetSessionLocale(Locale locale) Updates the locale of the current session.static voidsetSessionTimeZone(com.vaadin.flow.server.VaadinSession session, TimeZone timeZone) Updates the time zone of the given session.static voidsetSessionTimeZone(TimeZone timeZone) Updates the time zone of the current session.
-
Constructor Details
-
SessionLocaleUtils
public SessionLocaleUtils()
-
-
Method Details
-
getSessionLocale
Returns the locale of the current session.- Returns:
- the session locale
-
setSessionLocale
Updates the locale of the current session.- Parameters:
locale- the new session locale
-
getSessionLocale
Returns the locale of the given session.This method cannot be called while already holding the lock to a different Vaadin session than the provided one.
- Parameters:
session- the session to update- Returns:
- the session locale
-
setSessionLocale
Updates the locale of the given session.This method cannot be called while already holding the lock to a different Vaadin session than the provided one.
- Parameters:
session- the session to updatelocale- the new session locale
-
getSessionTimeZone
Returns the time zone of the current session.- Returns:
- the session time zone
-
setSessionTimeZone
Updates the time zone of the current session.- Parameters:
timeZone- the new session time zone
-
getSessionTimeZone
Returns the time zone of the given session.This method cannot be called while already holding the lock to a different Vaadin session than the provided one.
- Parameters:
session- the session to update- Returns:
- the session time zone
-
setSessionTimeZone
public static void setSessionTimeZone(com.vaadin.flow.server.VaadinSession session, TimeZone timeZone) Updates the time zone of the given session.This method cannot be called while already holding the lock to a different Vaadin session than the provided one.
- Parameters:
session- the session to updatetimeZone- the new session time zone
-