LinkedList封装DBSet
package com.util;
import java.util.LinkedList;
import java.util.Map;
import static java.lang.Integer.parseInt;
public class DBSet extends LinkedList<Object> {
private static final long serialVersionUID = 1L;
public String getValue(int paramInt, String paramString) {
return getValue(paramInt, paramString, true);
}
@SuppressWarnings({ "WeakerAccess", "Annotation" })
public String getValue(int paramInt, String paramString, boolean paramBoolean) {
String str = "";
if (paramInt >= size()) {
return str;
}
Object obj = ((Map<String, Object>) get(paramInt)).get(paramString);
if (obj instanceof Long) {
str = obj.toString();
} else {
str = String.valueOf(obj);
}
if (str == null || "null".equals(str)) {
str = "";
}
if (paramBoolean) {
str = str.trim();
}
return str;
}
@SuppressWarnings({ "WeakerAccess", "Annotation", "SameParameterValue" })
public int getIntValue(int paramInt, String paramString) {
int i = 0;
try {
i = parseInt(getValue(paramInt, paramString, true));
} catch (Exception ignored) {
ignored.printStackTrace();
}
return i;
}
public String getValue(String paramString) {
String str;
str = getValue(0, paramString, true);
return str;
}
public String getValue(String paramString, boolean paramBoolean) {
String str;
str = getValue(0, paramString, paramBoolean);
return str;
}
public int getIntValue(String paramString) {
int i = 0;
try {
i = getIntValue(0, paramString);
} catch (Exception ignored) {
ignored.printStackTrace();
}
return i;
}
}