com.perforce.p4java.impl.generic.client
Class ClientSubmitOptions

java.lang.Object
  extended by com.perforce.p4java.impl.generic.client.ClientSubmitOptions
All Implemented Interfaces:
IClientSummary.IClientSubmitOptions

public class ClientSubmitOptions
extends Object
implements IClientSummary.IClientSubmitOptions

Simple generic IClientSubmitOptions implementation class. Attempts to enforce the mutual-exclusivity of the options, but this can easily be circumvented.


Field Summary
 
Fields inherited from interface com.perforce.p4java.client.IClientSummary.IClientSubmitOptions
LEAVE_UNCHANGED, LEAVE_UNCHANGED_REOPEN, REOPEN, REVERT_UNCHANGED, REVERT_UNCHANGED_REOPEN, SUBMIT_UNCHANGED, SUBMIT_UNCHANGED_REOPEN
 
Constructor Summary
ClientSubmitOptions()
          Default constructor; sets all fields to false.
ClientSubmitOptions(boolean submitunchanged, boolean submitunchangedReopen, boolean revertunchanged, boolean revertunchangedReopen, boolean leaveunchanged, boolean leaveunchangedReopen)
          Explicit-value constructor.
ClientSubmitOptions(String optString)
          Attempts to construct a ClientSubmitOptions object from a typical p4 cmd options string, e.g.
 
Method Summary
 boolean isLeaveunchanged()
           
 boolean isLeaveunchangedReopen()
           
 boolean isRevertunchanged()
           
 boolean isRevertunchangedReopen()
           
 boolean isSubmitunchanged()
           
 boolean isSubmitunchangedReopen()
           
protected  void resetOptions()
           
 void setLeaveunchanged(boolean leaveunchanged)
           
 void setLeaveunchangedReopen(boolean leaveunchangedReopen)
           
 void setRevertunchanged(boolean revertunchanged)
           
 void setRevertunchangedReopen(boolean revertunchangedReopen)
           
 void setSubmitunchanged(boolean submitunchanged)
           
 void setSubmitunchangedReopen(boolean submitunchangedReopen)
           
 String toString()
          Return a Perforce-standard representation of these options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientSubmitOptions

public ClientSubmitOptions()
Default constructor; sets all fields to false.


ClientSubmitOptions

public ClientSubmitOptions(String optString)
Attempts to construct a ClientSubmitOptions object from a typical p4 cmd options string, e.g. "revertunchanged+reopen", or from a map returned from the server (where it's more commonly in the format "revertunchangedReopen". If optString is null, this is equivalent to calling the default constructor.

Note that the optString parser is fairly permissive in what it will accept; for example, the string "submitunchanged submitunchanged+reopen" is accepted just fine even though it's a little redundant, and no real attempt is made to enforce the mutual exclusivity of the options.


ClientSubmitOptions

public ClientSubmitOptions(boolean submitunchanged,
                           boolean submitunchangedReopen,
                           boolean revertunchanged,
                           boolean revertunchangedReopen,
                           boolean leaveunchanged,
                           boolean leaveunchangedReopen)
Explicit-value constructor. Note that nonsensical constructs like submitunchanged = false and submitunchangedReopen = true are accepted silently; also, no attempt is made to enforce mutual exclusivity here.

Method Detail

toString

public String toString()
Return a Perforce-standard representation of these options. This string is in the same format as used by the ClientSubmitOptions(String optionsString) constructor. Mirrors p4 cmd's behaviour in omitting non-set values.

Overrides:
toString in class Object

isSubmitunchanged

public boolean isSubmitunchanged()
Specified by:
isSubmitunchanged in interface IClientSummary.IClientSubmitOptions

setSubmitunchanged

public void setSubmitunchanged(boolean submitunchanged)
Specified by:
setSubmitunchanged in interface IClientSummary.IClientSubmitOptions

isSubmitunchangedReopen

public boolean isSubmitunchangedReopen()
Specified by:
isSubmitunchangedReopen in interface IClientSummary.IClientSubmitOptions

setSubmitunchangedReopen

public void setSubmitunchangedReopen(boolean submitunchangedReopen)
Specified by:
setSubmitunchangedReopen in interface IClientSummary.IClientSubmitOptions

isRevertunchanged

public boolean isRevertunchanged()
Specified by:
isRevertunchanged in interface IClientSummary.IClientSubmitOptions

setRevertunchanged

public void setRevertunchanged(boolean revertunchanged)
Specified by:
setRevertunchanged in interface IClientSummary.IClientSubmitOptions

isRevertunchangedReopen

public boolean isRevertunchangedReopen()
Specified by:
isRevertunchangedReopen in interface IClientSummary.IClientSubmitOptions

setRevertunchangedReopen

public void setRevertunchangedReopen(boolean revertunchangedReopen)
Specified by:
setRevertunchangedReopen in interface IClientSummary.IClientSubmitOptions

isLeaveunchanged

public boolean isLeaveunchanged()
Specified by:
isLeaveunchanged in interface IClientSummary.IClientSubmitOptions

setLeaveunchanged

public void setLeaveunchanged(boolean leaveunchanged)
Specified by:
setLeaveunchanged in interface IClientSummary.IClientSubmitOptions

isLeaveunchangedReopen

public boolean isLeaveunchangedReopen()
Specified by:
isLeaveunchangedReopen in interface IClientSummary.IClientSubmitOptions

setLeaveunchangedReopen

public void setLeaveunchangedReopen(boolean leaveunchangedReopen)
Specified by:
setLeaveunchangedReopen in interface IClientSummary.IClientSubmitOptions

resetOptions

protected void resetOptions()


Copyright © 2015 Perforce Software. All Rights Reserved.