Class XLanguageUtils
java.lang.Object
de.xima.fc.utils.XLanguageUtils
Utility class for providing default languages
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptiongetAvailableDefaultLanguages(Locale displayLocale) Returns a map of language display names and their IETF BCP 47 language tagstatic booleanisMethodImplementedBy(Class<?> target, Object instance, String methodName, Class<?>... params) Checks whether the given method is implemented by the given target class.static IntegerparseIntOrNull(String value) Parses the value as an integer, if possible, or returns null if it cannot be parsed.static LongparseLongOrNull(String value) Parses the value as a long, if possible, or returns null if it cannot be parsed.
-
Method Details
-
getAvailableDefaultLanguages
Returns a map of language display names and their IETF BCP 47 language tag -
isMethodImplementedBy
public static boolean isMethodImplementedBy(Class<?> target, Object instance, String methodName, Class<?>... params) Checks whether the given method is implemented by the given target class. Returns false when implemented by a subclass. For example:interface A { default void foo() {} default void bar() {} } class B implements A { public void foo() {} } // false, because foo is implemented by B isMethodImplementedBy(A.class, new B(), "foo") // true, because B inherits the implementation of bar from A isMethodImplementedBy(A.class, new B(), "bar")- Parameters:
target- The target class.instance- The instance to check.methodName- The name of the method.params- The parameter types of the method.- Returns:
truewhen the method is implemented by the target class.
-
parseIntOrNull
-
parseLongOrNull
-