Class MapUnmapper
java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.func.helper.MapUnmapper
Provides unmapping services to the P4Java RPC implementation.
These are not what they probably sound like -- they're basically
a way to serialise an input map for something like a changelist
or job onto a single byte buffer to be sent to the server as a
single data argument with newlines, tabs, etc.
The need for this will probably go away when we refactor the upper levels of P4Java to optimise and rationalise the use of maps overall.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringreplaceNewlines(String str) Replace all but the last newline in the incoming string with newline / tab pairs.static voidunmapBranchMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a BranchSpec spec.static voidunmapChangelistMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a change list.static voidunmapClientMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a client map.static voidunmapDepotMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a depot map.static voidunmapExtensionMap(Map<String, Object> inMap, StringBuffer strBuf) static voidunmapJobMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a job.static voidunmapLabelMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a Label Perforce label.static voidunmapLicenseMap(Map<String, Object> inMap, StringBuffer strBuf) static voidunmapProtectionEntriesMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a list of protection entries.static voidunmapSpecMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a spec.static voidunmapStreamMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a stream map.static voidunmapTriggerEntriesMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a list of trigger entries.static voidunmapUserGroupMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a Perforce user group map.static voidunmapUserMap(Map<String, Object> inMap, StringBuffer strBuf) Unmap a Perforce user map.
-
Constructor Details
-
MapUnmapper
public MapUnmapper()
-
-
Method Details
-
unmapChangelistMap
Unmap a change list. Absolutely no sanity or other checks are done on the passed-in map...- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapJobMap
Unmap a job. Jobs basically have free format defined by the associated jobspec (which we don't have access to here), so we have to try to the best we can with what we've got -- which is to dump the map to the strbuf while guessing at things like string formats, etc. This may prove error-prone in the long run.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapSpecMap
Unmap a spec. specs basically have free format so we have to try to the best we can with what we've got -- which is to dump the map to the strbuf while guessing at things like string formats, etc. This may prove error-prone in the long run.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapLicenseMap
-
unmapExtensionMap
-
unmapClientMap
Unmap a client map. Similar in intent and execution to unmapJobMap.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapUserMap
Unmap a Perforce user map.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapUserGroupMap
Unmap a Perforce user group map.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapLabelMap
Unmap a Label Perforce label.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapBranchMap
Unmap a BranchSpec spec.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapDepotMap
Unmap a depot map.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapProtectionEntriesMap
Unmap a list of protection entries.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapStreamMap
Unmap a stream map.- Parameters:
inMap- inMapstrBuf- strBuf
-
unmapTriggerEntriesMap
Unmap a list of trigger entries.- Parameters:
inMap- inMapstrBuf- strBuf
-
replaceNewlines
Replace all but the last newline in the incoming string with newline / tab pairs. Useful for various multi-line form inputs.- Parameters:
str- string- Returns:
- replaced string
-