Type { @Override public String toString() { final StringBuilder b = new StringBuilder(); if (!packageDeclaration.getName().isEmpty()) { b.append(packageDeclaration.getName()); b.append(Characters.DOT); } b.append(name); if (!genericDeclaration.getDeclaration().isEmpty()) { b.append('<'); b.append(genericDeclaration.getDeclaration()); b.append('>'); } return b.toString(); } Type(@Nonnull final Package pkg, @Nonnull final String name, @Nonnull final GenericDeclaration genericDeclaration);  Type(@Nonnull final String qualifiedName);  Type(@Nonnull final String packageName, @Nonnull final String typeName, @Nonnull final String genericDeclaration); @Nullable static Type evaluateJavaLangType(@Nonnull final String name); @Nonnull static Type of(@Nonnull final Class<?> clazz); @Override boolean equals(final Object obj); @Nonnull GenericDeclaration getGenericDeclaration(); @Nonnull String getName(); @Nonnull Package getPackage(); @Override int hashCode(); boolean isBoolean(); boolean isBoxedBoolean(); boolean isBoxedByte(); boolean isBoxedCharacter(); boolean isBoxedDouble(); boolean isBoxedFloat(); boolean isBoxedInteger(); boolean isBoxedLong(); boolean isBoxedShort(); boolean isBoxedType(); boolean isByte(); boolean isChar(); boolean isCollectionVariant(); boolean isDouble(); boolean isFloat(); boolean isInt(); boolean isJavaLangType(); boolean isLong(); boolean isNumber(); boolean isPrimitive(); boolean isShort(); boolean isString(); @Override String toString(); static final Type BOOLEAN; static final Type BOOLEAN_BOXED; static final Type BYTE; static final Type BYTE_BOXED; static final Type CHAR; static final Type CHARACTER_BOXED; static final Type DOUBLE; static final Type DOUBLE_BOXED; static final Type FLOAT; static final Type FLOAT_BOXED; static final Type INT; static final Type INTEGER_BOXED; static final Type LONG; static final Type LONG_BOXED; static final Type NUMBER; static final Type SHORT; static final Type SHORT_BOXED; static final Type STRING; static final List<Type> JAVA_LANG_VALUE_TYPES; }
@Test public void construct_innerInterface() { final Type type = new Type("com.github.before.Immutable$InnerInterface"); assertEquals("com.github.before.Immutable.InnerInterface", type.toString()); }
@Test public void toString_primitive() { final Type type = new Type("int"); assertEquals("int", type.toString()); }