Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
adapt
ace
Commits
4b45e9d0
Commit
4b45e9d0
authored
Apr 04, 2017
by
Michael Ritter
Browse files
Add the formatter to the IngestSummary
parent
3f8662d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
ace-am/src/main/java/edu/umiacs/ace/stats/IngestSummary.java
View file @
4b45e9d0
package
edu.umiacs.ace.stats
;
package
edu.umiacs.ace.stats
;
import
edu.umiacs.ace.util.FileSizeFormatter
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
...
@@ -8,12 +10,13 @@ import java.sql.Timestamp;
...
@@ -8,12 +10,13 @@ import java.sql.Timestamp;
*
*
* Created by shake on 8/29/16.
* Created by shake on 8/29/16.
*/
*/
public
final
class
IngestSummary
{
public
class
IngestSummary
{
public
final
Timestamp
date
;
public
final
Timestamp
date
;
public
final
String
collection
;
public
final
String
collection
;
public
final
String
group
;
public
final
String
group
;
public
final
Long
count
;
public
final
Long
count
;
public
final
BigDecimal
size
;
public
final
BigDecimal
size
;
private
FileSizeFormatter
formatter
;
public
IngestSummary
(
Timestamp
date
,
String
collection
,
String
group
,
Long
count
,
BigDecimal
size
)
{
public
IngestSummary
(
Timestamp
date
,
String
collection
,
String
group
,
Long
count
,
BigDecimal
size
)
{
this
.
date
=
date
;
this
.
date
=
date
;
...
@@ -42,4 +45,16 @@ public final class IngestSummary {
...
@@ -42,4 +45,16 @@ public final class IngestSummary {
public
BigDecimal
getSize
()
{
public
BigDecimal
getSize
()
{
return
size
;
return
size
;
}
}
public
String
getFormattedSize
()
{
if
(
formatter
==
null
)
{
return
size
+
" Bytes"
;
}
return
formatter
.
format
(
size
);
}
public
IngestSummary
setFormatter
(
FileSizeFormatter
formatter
)
{
this
.
formatter
=
formatter
;
return
this
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment