public final <T extends Factory<? extends Converter<?>>> T append(T next) { ChainedFactory f = this; while(f.next() != null) { if (!(f.next() instanceof ChainedFactory)) { throw new UnsupportedOperationException("Last element in the chain is not a ChainedFactory"); } f = (ChainedFactory) f.next(); } return f.withNext(next); }
public final <T extends Factory<? extends Converter<?>>> T append(T next) { ChainedFactory f = this; while(f.next() != null) { if (!(f.next() instanceof ChainedFactory)) { throw new UnsupportedOperationException("Last element in the chain is not a ChainedFactory"); } f = (ChainedFactory) f.next(); } return f.withNext(next); }