Java Class Name Create toClassName(String internalName)

Here you can find the source of toClassName(String internalName)

Description

Converts a class's internal name (i.e., using slashes) to Java source code format (i.e., using periods).

License

Apache License

Declaration

public static String toClassName(String internalName) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

public class Main {
    /**/*from  w  ww.  j  a  va 2 s  . c  o m*/
     * Converts a class's internal name (i.e., using slashes)
     * to Java source code format (i.e., using periods).
     */
    public static String toClassName(String internalName) {
        assert isNonBlank(internalName);

        return internalName.replace('/', '.');
    }

    public static boolean isNonBlank(String input) {
        return !isBlank(input);
    }

    public static boolean isBlank(String input) {
        return input == null || input.length() == 0
                || input.trim().length() == 0;
    }
}

Related

  1. toClassName(String className)
  2. toClassName(String className)
  3. toClassName(String className)
  4. toClassName(String fileName)
  5. toClassName(String fileName)
  6. toClassName(String resourceName)
  7. toClassName(String str)
  8. toClassNames(Class... classes)