Class RpcPacketFieldRule

java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.packet.helper.RpcPacketFieldRule
Direct Known Subclasses:
RpcPacketFieldPatternRule, RpcPacketFieldRangeRule

public abstract class RpcPacketFieldRule extends Object
Super class representing the rule for skipping the charset conversion of the RPC packet field values (bytes). Leave those field values as bytes instead of converting them to strings.
  • Field Details

    • FIELD_PATTERN

      public static final String FIELD_PATTERN
      The key for storing the field pattern in a command map.
      See Also:
    • START_FIELD

      public static final String START_FIELD
      The key for storing the start field name in a command map.
      See Also:
    • STOP_FIELD

      public static final String STOP_FIELD
      The key for storing the stop field name in a command map.
      See Also:
    • skipConversion

      protected boolean skipConversion
      If true, skip charset conversion; leave the value as is in bytes.
  • Constructor Details

    • RpcPacketFieldRule

      public RpcPacketFieldRule()
  • Method Details

    • getInstance

      public static RpcPacketFieldRule getInstance(Map<String,Object> cmdMap)
      Factory static method to create an instance of a subclass based on the content of a command map. Note that the instance creation will be processed in the order listed below.

      The existing of a FIELD_PATTERN key with a string value will create a RpcPacketFieldPatternRule object.

      The existing of both the START_FIELD and STOP_FIELD keys with string values will create a RpcPacketFieldRangeRule object.

      Parameters:
      cmdMap - cmdMap
      Returns:
      RpcPacketFieldRule
    • update

      public abstract void update(String fieldName)
      Updates the conversion rule.
      Parameters:
      fieldName - the field name
    • isSkipConversion

      public boolean isSkipConversion()
      Checks if is skip conversion.
      Returns:
      true, if is skip conversion