Changeset 2 for profileconnection/src/main
- Timestamp:
- 08/28/19 11:35:52 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
profileconnection/src/main/java/geniusweb/profileconnection/FileProfileConnector.java
r1 r2 10 10 11 11 import geniusweb.profile.Profile; 12 import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;13 12 14 13 /** … … 17 16 public class FileProfileConnector implements ProfileInterface { 18 17 private final static ObjectMapper jackson = new ObjectMapper(); 19 private final LinearAdditiveUtilitySpace profile;18 private final Profile profile; 20 19 21 20 /** … … 26 25 public FileProfileConnector(String filename) throws IOException { 27 26 Path path = new File(filename).toPath(); 28 String serialized = new String(Files.readAllBytes(path), 29 StandardCharsets.UTF_8); 30 profile = (LinearAdditiveUtilitySpace) jackson.readValue(serialized, 31 Profile.class); 27 String serialized = new String(Files.readAllBytes(path), StandardCharsets.UTF_8); 28 profile = jackson.readValue(serialized, Profile.class); 32 29 } 33 30 34 31 @Override 35 public LinearAdditiveUtilitySpace getProfile() {32 public Profile getProfile() { 36 33 return profile; 37 34 }
Note:
See TracChangeset
for help on using the changeset viewer.