Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
object NewPostFieldConvert {
fun postTypeToStr(type: PostType?): String? = type?.name
fun strToPostType(str: String?): PostType? = str?.let { PostType.valueOf(it) }
fun fileToPath(file: File?): String? = file?.absolutePath
fun pathToFile(path: String?): File? = path?.let { File(it) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment