* 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
29 lines
633 B
Java
29 lines
633 B
Java
package com.baeldung.caffeine;
|
|
|
|
final class DataObject {
|
|
private final String data;
|
|
|
|
private static int objectCounter = 0;
|
|
|
|
private DataObject(String data) {
|
|
this.data = data;
|
|
}
|
|
|
|
public String getData() {
|
|
return data;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "DataObject{" +
|
|
"data='" + data + '\'' +
|
|
'}';
|
|
}
|
|
|
|
public static DataObject get(String data) {
|
|
objectCounter++;
|
|
System.out.println(String.format("Initializing DataObject#%d with data '%s'", objectCounter, data));
|
|
return new DataObject(data);
|
|
}
|
|
}
|