Package de.codecamp.messages
Class MessageKeyUtils
- java.lang.Object
-
- de.codecamp.messages.MessageKeyUtils
-
public class MessageKeyUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description MessageKeyUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetKeyFor(Class<?> type)Returns the message key for the given type.static StringgetKeyFor(Class<?> type, String localPart)Returns the message key for the given type and local part.static StringgetKeyFor(Class<?> type, String localPartPrefix, String localPart)Returns the message key for the given type and local part.static StringgetKeyFor(Enum<?> enumConstant)Returns the message key for the given enum constant.static StringgetKeyFor(String prefix, String localPart)Returns the message key for the given prefix and local part.static StringgetKeyFor(String prefix, String localPartPrefix, String localPart)Returns the message key for the given prefix and local part.
-
-
-
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 keylocalPart- 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 keylocalPartPrefix- the local part prefix of the message keylocalPart- 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 keylocalPart- the local part of the message key- Returns:
- the message key
-
-