Class LocaleUtil


  • public class LocaleUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LocaleUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearMethodCaches()  
      static java.util.Locale determineLocale​(graphql.schema.DataFetchingEnvironment environment, java.util.Locale defaultLocale)
      This will try to determine the Locale from the data fetching env in a number of ways, searching via the context and source objects and the data fetching environment itself.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocaleUtil

        public LocaleUtil()
    • Method Detail

      • determineLocale

        public static java.util.Locale determineLocale​(graphql.schema.DataFetchingEnvironment environment,
                                                       java.util.Locale defaultLocale)
        This will try to determine the Locale from the data fetching env in a number of ways, searching via the context and source objects and the data fetching environment itself. This plugs a gap while graphql-java does not have a getLocale on ExecutionInput / DataFetchingEnvironment
        Parameters:
        environment - the fetching env
        defaultLocale - the default to use
        Returns:
        a Locale
      • clearMethodCaches

        public static void clearMethodCaches()