DefaultComponentDescriptor extends DefaultComponentRole<T> implements ComponentDescriptor<T> { @Override public String toString() { ToStringBuilder builder = new XWikiToStringBuilder(this); builder.append(super.toString()); builder.append("implementation", getImplementation() == null ? null : getImplementation().getName()); builder.append("instantiation", getInstantiationStrategy()); return builder.toString(); } DefaultComponentDescriptor();  DefaultComponentDescriptor(ComponentDescriptor<T> descriptor); void setImplementation(Class<? extends T> implementation); @Override Class<? extends T> getImplementation(); void setInstantiationStrategy(ComponentInstantiationStrategy instantiationStrategy); @Override ComponentInstantiationStrategy getInstantiationStrategy(); @Override Collection<ComponentDependency<?>> getComponentDependencies(); void addComponentDependency(ComponentDependency<?> componentDependency); void addComponentDependency(Class<D> role, String roleHint); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode();  }
@Test void testToString() { DefaultComponentDescriptor cd = new DefaultComponentDescriptor(); cd.setImplementation(ImplRole.class); cd.setRoleType(Role.class); cd.setRoleHint("hint"); DefaultComponentDependency dep = new DefaultComponentDependency(); dep.setName("name2"); dep.setRoleType(String.class); cd.addComponentDependency(dep); assertEquals( "role = [interface org.xwiki.component.descriptor.DefaultComponentDescriptorTest$Role], hint = [hint]], implementation = [org.xwiki.component.descriptor.DefaultComponentDescriptorTest$ImplRole], instantiation = [SINGLETON]", cd.toString()); }