package com.perforce.p4java_ext; import java.util.Date; import java.util.Map; /** * A simple wrapper around the map output of P4Files with bean style helper methods. * <p/> * Example map output in JSON: * <pre> * "time": "1382546942", * "rev": "1", * "change": "139", * "action": "add", * "depotFile": "//commons/spaces/10/files/b sort.java", * "type": "text" * </pre> */ public class FileSummary { private Map<String, Object> results; public FileSummary(Map<String, Object> results) { this.results = results; } public Map<String, Object> getResults() { return results; } public void setResults(Map<String, Object> results) { this.results = results; } public String get(String key) { return ((String) this.results.get(key)).trim(); } public Date getTime() { // believed to be in seconds long time = Long.valueOf(get("time"), 10); return new Date(time * 1000); } public int getRev() { return Integer.valueOf(get("rev"), 10); } public int getChange() { return Integer.valueOf(get("change"), 10); } public String getAction() { return get("action"); } public String getDepotFile() { return get("depotFile"); } public String getType() { return get("type"); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 9086 | tjuricek |
0.1.0 Initial release of p4java_ext Mostly just contains enough of the P4 API to build the test data initializer. About 4 commands have minimal testing, so it works. Kind of. |
||
#1 | 9085 | tjuricek | First import of the project, before package refactoring. |