Use object composition to wrap the adaptee with a modified interface.
public class EnumerationIterator implements Iterator<Object>{ Enumeration<Object> enumeration; public EnumerationIterator(Enumeration<Object> enumeration){ this.enumeration = enumeration; } @Override public boolean hasNext() { return enumeration.hasMoreElements(); } @Override public Object next() { return enumeration.nextElement(); } @Override public void remove() { throw new UnsupportedOperationException(); } }
Facade Mode: Provides a unified interface for accessing a group of interfaces in a subsystem. The Facade pattern defines a high-level interface that makes the subsystem easier to use.
Facade pattern is used when you need to simplify and unify a large interface or a group of complex interfaces.