Files
java-design-patterns/template-method/src/main/java/com/iluwatar/templatemethod/HalflingThief.java

24 lines
373 B
Java
Raw Normal View History

2015-08-21 23:19:55 +03:00
package com.iluwatar.templatemethod;
/**
*
* Halfling thief uses {@link StealingMethod} to steal.
*
*/
public class HalflingThief {
private StealingMethod method;
public HalflingThief(StealingMethod method) {
this.method = method;
}
public void steal() {
method.steal();
}
public void changeMethod(StealingMethod method) {
this.method = method;
}
}