提交 25ddf239 编写于 作者: Y yong.you

sort the code

上级 01ea985d
......@@ -5,6 +5,12 @@ public enum Action implements org.unidal.web.mvc.Action {
DASHBOARD("dashboard");
private String m_name;
private Action(String name) {
m_name = name;
}
public static Action getByName(String name, Action defaultAction) {
for (Action action : Action.values()) {
if (action.getName().equals(name)) {
......@@ -15,12 +21,6 @@ public enum Action implements org.unidal.web.mvc.Action {
return defaultAction;
}
private String m_name;
private Action(String name) {
m_name = name;
}
@Override
public String getName() {
return m_name;
......
......@@ -29,14 +29,18 @@ public class Model extends AbstractReportModel<Action, Context> {
private Map<Integer, Abtest> m_abtests;
public Range[] getAllRange() {
return Range.values();
}
public Model(Context ctx) {
super(ctx);
}
public Map<Integer, Abtest> getAbtests() {
return m_abtests;
}
public Range[] getAllRange() {
return Range.values();
}
@Override
public Action getDefaultAction() {
return Action.METRIC;
......@@ -52,44 +56,40 @@ public class Model extends AbstractReportModel<Action, Context> {
return new HashSet<String>();
}
public Collection<ProductLine> getProductLines() {
return m_productLines;
}
public void setProductLines(Collection<ProductLine> productLines) {
m_productLines = productLines;
public Date getEndTime() {
return m_endTime;
}
public List<LineChart> getLineCharts() {
return m_lineCharts;
}
public void setLineCharts(List<LineChart> lineCharts) {
m_lineCharts = lineCharts;
public Collection<ProductLine> getProductLines() {
return m_productLines;
}
public Date getStartTime() {
return m_startTime;
}
public void setStartTime(Date startTime) {
m_startTime = startTime;
}
public Date getEndTime() {
return m_endTime;
public void setAbtests(Map<Integer, Abtest> abtests) {
m_abtests = abtests;
}
public void setEndTime(Date endTime) {
m_endTime = endTime;
}
public void setAbtests(Map<Integer, Abtest> abtests) {
m_abtests = abtests;
public void setLineCharts(List<LineChart> lineCharts) {
m_lineCharts = lineCharts;
}
public Map<Integer, Abtest> getAbtests() {
return m_abtests;
public void setProductLines(Collection<ProductLine> productLines) {
m_productLines = productLines;
}
public void setStartTime(Date startTime) {
m_startTime = startTime;
}
}
......@@ -39,64 +39,64 @@ public class Payload extends AbstractReportPayload<Action> {
return m_action;
}
@Override
public ReportPage getPage() {
return m_page;
}
public void setAction(String action) {
m_action = Action.getByName(action, Action.METRIC);
public int getFrequency() {
return m_frequency;
}
@Override
public void setPage(String page) {
m_page = ReportPage.getByName(page, ReportPage.METRIC);
public ReportPage getPage() {
return m_page;
}
public String getProduct() {
return m_product;
}
public void setProduct(String product) {
m_product = product;
}
public String getTest() {
return m_test;
}
public void setTest(String test) {
m_test = test;
}
public int getTimeRange() {
return m_timeRange;
}
public int getFrequency() {
return m_frequency;
}
public void setFrequency(int frequency) {
m_frequency = frequency;
public boolean isFullScreen() {
return m_fullScreen;
}
public boolean isRefresh() {
return m_refresh;
}
public void setRefresh(boolean refresh) {
m_refresh = refresh;
public void setAction(String action) {
m_action = Action.getByName(action, Action.METRIC);
}
public boolean isFullScreen() {
return m_fullScreen;
public void setFrequency(int frequency) {
m_frequency = frequency;
}
public void setFullScreen(boolean fullScreen) {
m_fullScreen = fullScreen;
}
@Override
public void setPage(String page) {
m_page = ReportPage.getByName(page, ReportPage.METRIC);
}
public void setProduct(String product) {
m_product = product;
}
public void setRefresh(boolean refresh) {
m_refresh = refresh;
}
public void setTest(String test) {
m_test = test;
}
@Override
public void validate(ActionContext<?> ctx) {
if (m_action == null) {
......
......@@ -13,23 +13,15 @@ public enum Range {
ONE_DAY("24小时", 24), ;
private String m_title;
private int m_duration;
private Range(String title, int duration) {
m_title = title;
m_duration = duration;
}
public String getTitle() {
return m_title;
}
public int getDuration() {
return m_duration;
}
private String m_title;
private int m_duration;
public static Range getByTitle(String title, Range defaultRange) {
for (Range range : Range.values()) {
if (range.getTitle().equals(title)) {
......@@ -38,4 +30,12 @@ public enum Range {
}
return defaultRange;
}
public int getDuration() {
return m_duration;
}
public String getTitle() {
return m_title;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册