@ -78,14 +78,15 @@ public class Request implements Serializable {
return this;
}
public Object getExtra(String key) {
@SuppressWarnings("unchecked")
public <T> T getExtra(String key) {
if (extras == null) {
return null;
return extras.get(key);
return (T) extras.get(key);
public Request putExtra(String key, Object value) {
public <T> Request putExtra(String key, T value) {
extras = new HashMap<String, Object>();
@ -1,6 +1,5 @@
package us.codecraft.webmagic;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
@ -21,6 +20,7 @@ public class ResultItems {
private boolean skip;
public <T> T get(String key) {
Object o = fields.get(key);
if (o == null) {