Class ReflectionUtils
- java.lang.Object
-
- net.morimekta.providence.reflect.util.ReflectionUtils
-
public class ReflectionUtils extends java.lang.ObjectSimple utility for type checking and matching.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static java.lang.StringgetFileName(java.nio.file.Path path)Get file name without suffix.static java.lang.StringgetFileSuffix(java.nio.file.Path path)Get file suffix.static booleanisApacheThriftFile(java.nio.file.Path file)static booleanisDeclaredType(net.morimekta.providence.descriptor.PDeclaredDescriptor<?> descriptor)static booleanisProvidenceFile(java.io.File file)Deprecated.static booleanisProvidenceFile(java.lang.String filePath)Deprecated.static booleanisProvidenceFile(java.nio.file.Path file)static booleanisProvidenceFileSuffix(java.lang.String suffix)static booleanisThriftBasedFileSyntax(java.nio.file.Path file)static booleanisThriftFile(java.io.File file)Deprecated.static booleanisThriftFile(java.lang.String filePath)Deprecated.static booleanisThriftFileSuffix(java.lang.String suffix)static java.lang.StringlongestCommonPrefixPath(java.util.Collection<java.lang.String> paths)static java.lang.StringprogramNameFromPath(java.lang.String filePath)Deprecated.static java.lang.StringprogramNameFromPath(java.nio.file.Path filePath)static java.util.List<java.lang.String>stripCommonPrefix(java.util.List<java.lang.String> paths)
-
-
-
Method Detail
-
isDeclaredType
public static boolean isDeclaredType(net.morimekta.providence.descriptor.PDeclaredDescriptor<?> descriptor)
- Parameters:
descriptor- A declared type descriptor.- Returns:
- If this type was declared directly. If false, this is an auto -declared type, like service method request and response.
-
isThriftFile
@Deprecated public static boolean isThriftFile(@Nonnull java.io.File file)Deprecated.
-
isThriftFile
@Deprecated public static boolean isThriftFile(@Nonnull java.lang.String filePath)Deprecated.
-
isProvidenceFile
@Deprecated public static boolean isProvidenceFile(@Nonnull java.io.File file)Deprecated.
-
isProvidenceFile
@Deprecated public static boolean isProvidenceFile(@Nonnull java.lang.String filePath)Deprecated.
-
programNameFromPath
@Nonnull @Deprecated public static java.lang.String programNameFromPath(@Nonnull java.lang.String filePath)Deprecated.
-
getFileName
@Nonnull protected static java.lang.String getFileName(@Nonnull java.nio.file.Path path)Get file name without suffix.- Parameters:
path- The file path.- Returns:
- The file name without suffix.
-
getFileSuffix
@Nonnull public static java.lang.String getFileSuffix(@Nonnull java.nio.file.Path path)Get file suffix. The file suffix is all that is not considered the file name.- Parameters:
path- The file path.- Returns:
- The suffix.
-
isThriftFileSuffix
public static boolean isThriftFileSuffix(@Nonnull java.lang.String suffix)
-
isProvidenceFileSuffix
public static boolean isProvidenceFileSuffix(@Nonnull java.lang.String suffix)
-
isProvidenceFile
public static boolean isProvidenceFile(@Nonnull java.nio.file.Path file)
-
isApacheThriftFile
public static boolean isApacheThriftFile(@Nonnull java.nio.file.Path file)
-
isThriftBasedFileSyntax
public static boolean isThriftBasedFileSyntax(@Nonnull java.nio.file.Path file)
-
programNameFromPath
@Nonnull public static java.lang.String programNameFromPath(@Nonnull java.nio.file.Path filePath)
-
longestCommonPrefixPath
@Nonnull public static java.lang.String longestCommonPrefixPath(java.util.Collection<java.lang.String> paths)
-
stripCommonPrefix
@Nonnull public static java.util.List<java.lang.String> stripCommonPrefix(java.util.List<java.lang.String> paths)
-
-