com.h3c.util.pkt

## Class Icmp.Builder

- java.lang.Object
- - com.h3c.util.pkt.Icmp.Builder

- Enclosing class:
    Icmp

      public static class Icmp.Builder
      extends Object

  Builder (mutable) used to create new protocol instances.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Icmp.Builder()` Create a new builder using the defaults:
    `Icmp.Builder(Icmp icmp)` Copy constructor builder initialized from the passed in protocol.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Icmp` | `build()` Creates a new protocol instance from this builder.
    `Icmp.Builder` | `bytes(byte[] bytes)` Sets the payload bytes.
    `Icmp.Builder` | `ident(int ident)` Sets the identifier for `IcmpTypeCode.ECHO_REQ` or `IcmpTypeCode.ECHO_REPLY` messages.
    `Icmp.Builder` | `seqNum(int seqNum)` Sets the sequence number for `IcmpTypeCode.ECHO_REQ` or `IcmpTypeCode.ECHO_REPLY` messages.
    `Icmp.Builder` | `typeCode(IcmpTypeCode typeCode)` Sets the type/code enumeration..

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Icmp.Builder

          public Icmp.Builder()

      Create a new builder using the defaults:

           typeCode = ECHO_REQ
           bytes = EMPTY_BYTES

    - #### Icmp.Builder

          public Icmp.Builder(Icmp icmp)

      Copy constructor builder initialized from the passed in protocol.
      Parameters:
        `icmp` - builder is initialed from this protocol's data

  - ### Method Detail

    - #### build

          public Icmp build()

      Creates a new protocol instance from this builder.
      Returns:
        the new protocol instance

    - #### typeCode

          public Icmp.Builder typeCode(IcmpTypeCode typeCode)

      Sets the type/code enumeration..
      Parameters:
        `typeCode` - type/code enumeration
      Returns:
        this instance

    - #### ident

          public Icmp.Builder ident(int ident)

      Sets the identifier for `IcmpTypeCode.ECHO_REQ` or `IcmpTypeCode.ECHO_REPLY` messages.
      Parameters:
        `ident` - identifier value
      Returns:
        this instance

    - #### seqNum

          public Icmp.Builder seqNum(int seqNum)

      Sets the sequence number for `IcmpTypeCode.ECHO_REQ` or `IcmpTypeCode.ECHO_REPLY` messages.
      Parameters:
        `seqNum` - sequence number value
      Returns:
        this instance

    - #### bytes

          public Icmp.Builder bytes(byte[] bytes)

      Sets the payload bytes.
      Parameters:
        `bytes` - payload bytes
      Returns:
        this instance

Copyright © 2014. All Rights Reserved.