Class RpcPacketFieldRule

  • Direct Known Subclasses:
    RpcPacketFieldPatternRule, RpcPacketFieldRangeRule

    public abstract class RpcPacketFieldRule
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FIELD_PATTERN
      The key for storing the field pattern in a command map.
      protected boolean skipConversion
      If true, skip charset conversion; leave the value as is in bytes.
      static java.lang.String START_FIELD
      The key for storing the start field name in a command map.
      static java.lang.String STOP_FIELD
      The key for storing the stop field name in a command map.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static RpcPacketFieldRule getInstance​(java.util.Map<java.lang.String,​java.lang.Object> cmdMap)
      Factory static method to create an instance of a subclass based on the content of a command map.
      boolean isSkipConversion()
      Checks if is skip conversion.
      abstract void update​(java.lang.String fieldName)
      Updates the conversion rule.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FIELD_PATTERN

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

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

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

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

      • RpcPacketFieldRule

        public RpcPacketFieldRule()
    • Method Detail

      • getInstance

        public static RpcPacketFieldRule getInstance​(java.util.Map<java.lang.String,​java.lang.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​(java.lang.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