Class TriggerEntry

java.lang.Object
com.perforce.p4java.impl.generic.core.MapEntry
com.perforce.p4java.impl.generic.admin.TriggerEntry
All Implemented Interfaces:
ITriggerEntry, IMapEntry

public class TriggerEntry extends MapEntry implements ITriggerEntry
Default ITriggerEntry implementation class.

Note that the order of this trigger entry in the triggers table is part of the trigger entry key when pass to the server for updating the triggers table.

 Triggers0 example1 change-submit //depot/... "echo %changelist%"
 Triggers1 example1 change-submit //depot/abc/... "echo %changelist%"
 Triggers2 example2 form-save client "echo %client%"
 Triggers3 example3 change-submit //depot/... "echo %changelist%"
 Triggers4 example4 change-submit //depot/... "echo %changelist%"
 
  • Constructor Details

    • TriggerEntry

      public TriggerEntry()
      Default constructor.
    • TriggerEntry

      public TriggerEntry(int order, String name, ITriggerEntry.TriggerType triggerType, String path, String command)
      Explicit-value constructor.
      Parameters:
      order - order
      name - name
      triggerType - triggerType
      path - path
      command - command
    • TriggerEntry

      public TriggerEntry(String triggerEntry, int order)
      Constructs a TriggerEntry from the passed-in trigger as a string and its order.
      Parameters:
      triggerEntry - triggerEntry
      order - order
  • Method Details

    • getName

      public String getName()
      Description copied from interface: ITriggerEntry
      Gets the trigger name.
      Specified by:
      getName in interface ITriggerEntry
      Returns:
      the trigger name
      See Also:
    • setName

      public void setName(String name)
      Description copied from interface: ITriggerEntry
      Sets the trigger name.
      Specified by:
      setName in interface ITriggerEntry
      Parameters:
      name - the trigger name
      See Also:
    • getTriggerType

      public ITriggerEntry.TriggerType getTriggerType()
      Description copied from interface: ITriggerEntry
      Gets the trigger type.
      Specified by:
      getTriggerType in interface ITriggerEntry
      Returns:
      the trigger type
      See Also:
    • setTriggerType

      public void setTriggerType(ITriggerEntry.TriggerType triggerType)
      Description copied from interface: ITriggerEntry
      Sets the trigger type.
      Specified by:
      setTriggerType in interface ITriggerEntry
      Parameters:
      triggerType - the trigger type
      See Also:
    • getPath

      public String getPath()
      Description copied from interface: ITriggerEntry
      For change and submit triggers, a file pattern to match files in the changelist. This file pattern can be an exclusion mapping (-pattern), to exclude files. For form triggers, the name of the form (branch, client, etc). For fix triggers 'fix' is required as the path value. For authentication triggers, 'auth' is required as the path value. For archive triggers, a file pattern to match the name of the file being accessed in the archive. Note that, due to lazy copying when branching files, the name of the file in the archive can not be the same as the name of the file in the depot. For command triggers, use the name of the command to match, e.g. 'pre-user-$cmd' or a regular expression, e.g. '(pre|post)-user-add'. *
      Specified by:
      getPath in interface ITriggerEntry
      Returns:
      the depot file path pattern or form type
      See Also:
    • setPath

      public void setPath(String path)
      Description copied from interface: ITriggerEntry
      For change and submit triggers, a file pattern to match files in the changelist. This file pattern can be an exclusion mapping (-pattern), to exclude files. For form triggers, the name of the form (branch, client, etc). For fix triggers 'fix' is required as the path value. For authentication triggers, 'auth' is required as the path value. For archive triggers, a file pattern to match the name of the file being accessed in the archive. Note that, due to lazy copying when branching files, the name of the file in the archive can not be the same as the name of the file in the depot. For command triggers, use the name of the command to match, e.g. 'pre-user-$cmd' or a regular expression, e.g. '(pre|post)-user-add'. *
      Specified by:
      setPath in interface ITriggerEntry
      Parameters:
      path - the depot file path pattern or form type
      See Also:
    • getCommand

      public String getCommand()
      Description copied from interface: ITriggerEntry
      Gets the trigger command. If the command contains spaces, enclose it in double quotes.
      Specified by:
      getCommand in interface ITriggerEntry
      Returns:
      the trigger comamnd
      See Also:
    • setCommand

      public void setCommand(String command)
      Description copied from interface: ITriggerEntry
      Sets the trigger command. If the command contains spaces, enclose it in double quotes.
      Specified by:
      setCommand in interface ITriggerEntry
      Parameters:
      command - the trigger command
      See Also:
    • toString

      public String toString()
      Description copied from class: MapEntry
      An alias for this.toString(" ", true).
      Specified by:
      toString in interface IMapEntry
      Overrides:
      toString in class MapEntry
      See Also: