mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-26 01:43:59 +02:00
Add clone method to ScaleMeasurement
This commit is contained in:
@@ -26,7 +26,7 @@ import com.j256.simplecsv.common.CsvColumn;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(tableName = "scaleMeasurements", indices = {@Index(value = {"datetime"}, unique = true)})
|
||||
public class ScaleMeasurement {
|
||||
public class ScaleMeasurement implements Cloneable {
|
||||
private static float KG_LB = 2.20462f;
|
||||
private static float KG_ST = 0.157473f;
|
||||
|
||||
@@ -85,6 +85,19 @@ public class ScaleMeasurement {
|
||||
comment = new String();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScaleMeasurement clone() {
|
||||
ScaleMeasurement clone;
|
||||
try {
|
||||
clone = (ScaleMeasurement) super.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException e) {
|
||||
throw new RuntimeException("failed to clone ScaleMeasurement", e);
|
||||
}
|
||||
clone.dateTime = (Date) dateTime.clone();
|
||||
return clone;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user