Ref: use lombok for data class
This commit is contained in:
@@ -19,7 +19,10 @@
|
||||
|
||||
package com.sheepit.client;
|
||||
|
||||
public class Stats {
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data @AllArgsConstructor public class Stats {
|
||||
private int remainingFrame;
|
||||
private long creditsEarned;
|
||||
private int creditsEarnedSession;
|
||||
@@ -27,48 +30,6 @@ public class Stats {
|
||||
private int waitingProject;
|
||||
private int connectedMachine;
|
||||
|
||||
public Stats(int frame, long credits, int creditsSession, int renderables, int waitings, int machines) {
|
||||
remainingFrame = frame;
|
||||
creditsEarned = credits;
|
||||
creditsEarnedSession = creditsSession;
|
||||
renderableProject = renderables;
|
||||
waitingProject = waitings;
|
||||
connectedMachine = machines;
|
||||
}
|
||||
|
||||
public Stats() {
|
||||
remainingFrame = 0;
|
||||
creditsEarned = 0;
|
||||
creditsEarnedSession = 0;
|
||||
renderableProject = 0;
|
||||
waitingProject = 0;
|
||||
connectedMachine = 0;
|
||||
}
|
||||
|
||||
public int getRemainingFrame() {
|
||||
return remainingFrame;
|
||||
}
|
||||
|
||||
public int getCreditsEarnedDuringSession() {
|
||||
return creditsEarnedSession;
|
||||
}
|
||||
|
||||
public long getCreditsEarned() {
|
||||
return creditsEarned;
|
||||
}
|
||||
|
||||
public int getRenderableProject() {
|
||||
return renderableProject;
|
||||
}
|
||||
|
||||
public int getWaitingProject() {
|
||||
return waitingProject;
|
||||
}
|
||||
|
||||
public int getConnectedMachine() {
|
||||
return connectedMachine;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return "Stats [remainingFrame=" + remainingFrame + ", creditsEarned=" + creditsEarned + ", creditsEarnedSession=" + creditsEarnedSession
|
||||
+ ", renderableProject=" + renderableProject + ", waitingProject=" + waitingProject + ", connectedMachine=" + connectedMachine + "]";
|
||||
|
||||
@@ -148,7 +148,7 @@ public class GuiText implements Gui {
|
||||
|
||||
@Override public void displayStats(Stats stats) {
|
||||
System.out.println(String.format("%s Frames remaining: %d", this.df.format(new Date()), stats.getRemainingFrame()));
|
||||
System.out.println(String.format("%s Credits earned: %d", this.df.format(new Date()), stats.getCreditsEarnedDuringSession()));
|
||||
System.out.println(String.format("%s Credits earned: %d", this.df.format(new Date()), stats.getCreditsEarnedSession()));
|
||||
}
|
||||
|
||||
@Override public void displayUploadQueueStats(int queueSize, long queueVolume) {
|
||||
|
||||
@@ -160,7 +160,7 @@ public class GuiTextOneLine implements Gui {
|
||||
}
|
||||
|
||||
@Override public void displayStats(Stats stats) {
|
||||
creditsEarned = String.valueOf(stats.getCreditsEarnedDuringSession());
|
||||
creditsEarned = String.valueOf(stats.getCreditsEarnedSession());
|
||||
updateLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ public class Working implements Activity {
|
||||
public void displayStats(Stats stats) {
|
||||
DecimalFormat df = new DecimalFormat("##,##,##,##,##,##,##0");
|
||||
remainingFrameContent.setText(df.format(stats.getRemainingFrame()));
|
||||
creditEarned.setText(df.format(stats.getCreditsEarnedDuringSession()));
|
||||
creditEarned.setText(df.format(stats.getCreditsEarnedSession()));
|
||||
user_info_points_total_value.setText(df.format(stats.getCreditsEarned()));
|
||||
renderable_projects_value.setText(df.format(stats.getRenderableProject()));
|
||||
waiting_projects_value.setText(df.format(stats.getWaitingProject()));
|
||||
|
||||
Reference in New Issue
Block a user