Class MessageKeyUtils


  • public class MessageKeyUtils
    extends Object
    • Constructor Detail

      • MessageKeyUtils

        public MessageKeyUtils()
    • Method Detail

      • getKeyFor

        public static String getKeyFor​(Class<?> type)
        Returns the message key for the given type.
        Parameters:
        type - the type
        Returns:
        the message key
      • getKeyFor

        public static String getKeyFor​(Enum<?> enumConstant)
        Returns the message key for the given enum constant.
        Parameters:
        enumConstant - the enum constant
        Returns:
        the message key
      • getKeyFor

        public static String getKeyFor​(Class<?> type,
                                       String localPart)
        Returns the message key for the given type and local part.
        Parameters:
        type - the type containing the message key
        localPart - the local part of the message key
        Returns:
        the message key
      • getKeyFor

        public static String getKeyFor​(Class<?> type,
                                       String localPartPrefix,
                                       String localPart)
        Returns the message key for the given type and local part.
        Parameters:
        type - the type containing the message key
        localPartPrefix - the local part prefix of the message key
        localPart - the local part of the message key
        Returns:
        the message key
      • getKeyFor

        public static String getKeyFor​(String prefix,
                                       String localPart)
        Returns the message key for the given prefix and local part.
        Parameters:
        prefix - the prefix of the message key (e.g. the fully qualified name of the type containing the message key)
        localPart - the local part of the message key
        Returns:
        the message key
      • getKeyFor

        public static String getKeyFor​(String prefix,
                                       String localPartPrefix,
                                       String localPart)
        Returns the message key for the given prefix and local part.
        Parameters:
        prefix - the prefix of the message key (e.g. the fully qualified name of the type containing the message key)
        localPartPrefix - the local part prefix of the message key
        localPart - the local part of the message key
        Returns:
        the message key