/** * Returns a string representation of this factory. This method is mostly for debugging purpose, * so the string format may vary across different implementations or versions. The default * implementation formats all {@linkplain #getImplementationHints implementation hints} as a * tree. If the implementation hints include some {@linkplain Factory factory} dependencies, * then the implementation hints for those dependencies will appears under a tree branch. * * @since 2.3 */ public String toString() { final String name = format(this); final Map done = new IdentityHashMap(); // We don't want to rely on Factory.equals(...) done.put(this, name); final String tree = format(getImplementationHints(), done); return name + System.getProperty("line.separator", "\n") + tree; }
/** * Returns a string representation of this factory. This method is mostly for debugging purpose, * so the string format may vary across different implementations or versions. The default * implementation formats all {@linkplain #getImplementationHints implementation hints} as a * tree. If the implementation hints include some {@linkplain Factory factory} dependencies, * then the implementation hints for those dependencies will appears under a tree branch. * * @since 2.3 */ @Override public String toString() { final String name = format(this); final Map<Factory,String> done = new IdentityHashMap<Factory,String>(); // We used IdentityHashMap above because we don't want to rely on Factory.equals(...) done.put(this, name); final String tree = format(getImplementationHints(), done); return name + System.getProperty("line.separator", "\n") + tree; }