Skip to content

Instantly share code, notes, and snippets.

@crimx
Created April 14, 2014 16:28
Show Gist options
  • Save crimx/10663131 to your computer and use it in GitHub Desktop.
Save crimx/10663131 to your computer and use it in GitHub Desktop.
Adapter Pattern
package com.crimx.adapter;
public class Adapter implements Plug2{
private Plug1 plug1;
public Adapter(Plug1 p1) {
Plug1 = p1;
}
public void slot1() {
Plug1.slot1();
}
}
package com.crimx.adapter;
public interface Plug1 {
public void slot1();
}
package com.crimx.adapter;
public interface Plug2 {
public void slot2();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment