A KindName representing the kind of a given class/interface type.
185830
public static KindName typeKindName(Type t) {
        if (t.hasTag(TYPEVAR) ||
            t.hasTag(CLASS) && (t.tsym.flags() & COMPOUND) != 0)
            return KindName.BOUND;
        else if (t.hasTag(PACKAGE))
            return KindName.PACKAGE;
        else if ((t.tsym.flags_field & ANNOTATION) != 0)
            return KindName.ANNOTATION;
        else if ((t.tsym.flags_field & INTERFACE) != 0)
            return KindName.INTERFACE;
        else
            return KindName.CLASS;
    }
983423
@Requires({
    "type != null",
    "type.getKind() == javax.lang.model.type.TypeKind.DECLARED"
  })
  @Ensures("result == null || result.getDeclaredName().equals(type.toString())")
  ClassName getClassNameForType(TypeMirror type) {
    DeclaredType tmp = (DeclaredType) type;
    TypeElement element = (TypeElement) tmp.asElement();
    String binaryName = elementUtils.getBinaryName(element)
        .toString().replace('.', '/');
    return new ClassName(binaryName, type.toString());
  }
609864
private String getTypeName(Type type)
    {
        String name;
        if (type instanceof Class) {
            name = ((Class<?>) type).getName();
        } else if (type instanceof ParameterizedType) {
            name = ((Class<?>) ((ParameterizedType) type).getRawType()).getName();
        } else {
            name = type.toString();
        }

        return name;
    }
945110
def p_typename(self,t):
    "'"
    t[0] = TypeX(t[1],None) if len(t) == 2 else TypeX(t[1],int(t[3]))
995060
public static boolean isEquals(TypeName value, TypeName kindOfParameter) {
		return value.toString().equals(kindOfParameter.toString());
	}
54471
public String getTypeName(Class<?> type) {
        Integer jdbcType = jdbcTypeMapping.get(type);
        if (jdbcType == null) {
            jdbcType = javaTypeMapping.getType(type).getSQLTypes()[0];
        }
        return templates.getTypeNameForCode(jdbcType);
    }
987155
def kind(units):
    
    for k, v in dicts.items():
        if units in v.keys():
            return k
727659
public static <T,V extends Object> void type(V value, Class<T> type) {
		if(!validation) return;
		notNull(value);
		notNull(type);
		if(!type.isAssignableFrom(value.getClass())){
			throw new TypeException(type.getCanonicalName());
		}
	}
765238
private static void simpleClassTypeSignature(Result sb, TypeMirror type) throws IOException
    {
        switch (type.getKind())
        {
            case DECLARED:
                DeclaredType dt = (DeclaredType) type;
                TypeElement te = (TypeElement) dt.asElement();
                nestedSimpleName(sb, te);
                typeArguments(sb, dt.getTypeArguments());
                break;
            default:
                throw new UnsupportedOperationException(type.getKind()+" unsupported");
        }
    }
960229
def type_name(self, t, generate=True):
        
        # no Test case for these
        # elif isinstance(t, typedesc.Argument):
        # elif isinstance(t, typedesc.CvQualifiedType):
        # elif isinstance(t, typedesc.Variable):
        #   return "%s" % self.type_name(t.typ, generate)
        # elif isinstance(t, typedesc.Enumeration):
        #   return t.name

        if isinstance(t, typedesc.FundamentalType):
            return self.FundamentalType(t)
        elif isinstance(t, typedesc.ArrayType):
            return "%s * %s" % (self.type_name(t.typ, generate), t.size)
        elif isinstance(t, typedesc.PointerType):
            self.enable_pointer_type()
            return "POINTER_T(%s)" % (self.type_name(t.typ, generate))
        elif isinstance(t, typedesc.FunctionType):
            args = [
                self.type_name(
                    x,
                    generate) for x in [
                    t.returns] +
                list(
                    t.iterArgTypes())]
            if "__stdcall__" in t.attributes:
                return "ctypes.WINFUNCTYPE(%s)" % ", ".join(args)
            else:
                return "ctypes.CFUNCTYPE(%s)" % ", ".join(args)
        # elif isinstance(t, typedesc.Structure):
        # elif isinstance(t, typedesc.Typedef):
        # elif isinstance(t, typedesc.Union):
        return t.name
354903
def type
            name = (self.class.name or self.class.superclass.name or self.native_type.name)

            name.split("::").last.to_sym
        end
764758
public Diagnostic.Kind getKind() {
        switch (type) {
        case NOTE:
            return Diagnostic.Kind.NOTE;
        case WARNING:
            return flags.contains(DiagnosticFlag.MANDATORY)
                    ? Diagnostic.Kind.MANDATORY_WARNING
                    : Diagnostic.Kind.WARNING;
        case ERROR:
            return Diagnostic.Kind.ERROR;
        default:
            return Diagnostic.Kind.OTHER;
        }
    }
248381
public static TypeName typeName(String typeName) {
		TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
				TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };

		for (TypeName item : values) {
			if (item.toString().equals(typeName)) {
				return item;
			}
		}

		LiteralType literalName = LiteralType.of(typeName);
		if (literalName.isParametrizedType()) {
			return ParameterizedTypeName.get(className(literalName.getRawType()),
					typeName(literalName.getTypeParameter()));
		}
		if (literalName.isArray()) {
			return ArrayTypeName.of(typeName(literalName.getRawType()));
		}

		return ClassName.bestGuess(typeName);
	}
1026795
private String getTypeString(Class<?> c)
   {
      String result = TYPE_MAP.get(c);
      if (result == null)
      {
         result = c.getName();
         if (!result.endsWith(";") && !result.startsWith("["))
         {
            result = "L" + result + ";";
         }
      }
      return result;
   }
1302900
def chpl_type_name(self):
        """"""
        if not self.objtype.endswith('method'):
            return ''
        elif self.objtype.startswith('iter'):
            return 'iterator'
        elif self.objtype == 'method':
            return 'method'
        else:
            return ''
38596
private void genClassSignature(TypeElement type, StringBuilder sb) {
    genOptFormalTypeParameters(type.getTypeParameters(), sb);
    // JDT returns null for an interface's superclass, but signatures expect Object.
    if (type.getKind().isInterface()) {
      sb.append(JAVA_OBJECT_SIGNATURE);
    } else {
      genTypeSignature(type.getSuperclass(), sb);
    }
    for (TypeMirror intrface : type.getInterfaces()) {
      genTypeSignature(intrface, sb);
    }
  }
938544
public static Matcher<ClassTree> nestingKind(final NestingKind kind) {
    return new Matcher<ClassTree>() {
      @Override
      public boolean matches(ClassTree classTree, VisitorState state) {
        ClassSymbol sym = ASTHelpers.getSymbol(classTree);
        return sym.getNestingKind() == kind;
      }
    };
  }