BAEL-1041 Caffeine (#2734)
* BAEL-748 quick guide to @Value * BAEL-748 changes from review * BAEL-748 inject comma-separated values into array * BAEL-768 Introduction to Netty * BAEL-768 remove commented code * BAEL-861 Introduction to Awaitility * BAEL-861 rename Test to UnitTest * BAEL-1041 Introduction in Caffeine * BAEL-1041 fix test * BAEL-1041 fix formatting * BAEL-1041 fix expected/actual order * BAEL-1041 remove trailing underscore * Formatting after merge * BAEL-1041 add spaces between data and assertions * BAEL-1041 soft values example * BAEL-1041 remove duplicate dependency * BAEL-1041 formatting fix * BAEL-1041 formatting fix * BAEL-1041 use logger instead of sout
This commit is contained in:
parent
56af2a7318
commit
5df269f171
@ -1,9 +1,13 @@
|
|||||||
package com.baeldung.caffeine;
|
package com.baeldung.caffeine;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
final class DataObject {
|
final class DataObject {
|
||||||
private final String data;
|
private final String data;
|
||||||
|
|
||||||
private static int objectCounter = 0;
|
private static int objectCounter = 0;
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(DataObject.class);
|
||||||
|
|
||||||
private DataObject(String data) {
|
private DataObject(String data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
@ -22,7 +26,7 @@ final class DataObject {
|
|||||||
|
|
||||||
public static DataObject get(String data) {
|
public static DataObject get(String data) {
|
||||||
objectCounter++;
|
objectCounter++;
|
||||||
System.out.println(String.format("Initializing DataObject#%d with data '%s'", objectCounter, data));
|
log.info("Init DataObject#{} with '{}'", objectCounter, data);
|
||||||
return new DataObject(data);
|
return new DataObject(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user