com.h3c.util.pkt

## Class Tcp.Builder

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

- Enclosing class:
    Tcp

      public static class Tcp.Builder
      extends Object

  Builder (mutable) used to create new protocol instances.

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Tcp.Builder` | `ackNum(long ackNum)` Sets the acknowledgment number.
    `Tcp` | `build()` Creates a new protocol instance from this builder.
    `Tcp.Builder` | `dstPort(TcpUdpPort dstPort)` Sets the destination port.
    `Tcp.Builder` | `flags(int flags)` Sets the flags.
    `Tcp.Builder` | `options(byte[] options)` Sets the options.
    `Tcp.Builder` | `seqNum(long seqNum)` Sets the sequence number.
    `Tcp.Builder` | `srcPort(TcpUdpPort srcPort)` Sets the source port.
    `Tcp.Builder` | `urgentPtr(int urgentPtr)` Sets the urgent pointer.
    `Tcp.Builder` | `winSize(int winSize)` Sets the window size.

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

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

- - ### Constructor Detail

    - #### Tcp.Builder

          public Tcp.Builder()

      Create a new builder using the defaults:

           dstPort = 0
           srcPort = 0

    - #### Tcp.Builder

          public Tcp.Builder(Tcp tcp)

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

  - ### Method Detail

    - #### build

          public Tcp build()

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

    - #### dstPort

          public Tcp.Builder dstPort(TcpUdpPort dstPort)

      Sets the destination port.
      Parameters:
        `dstPort` - destination port
      Returns:
        this instance

    - #### srcPort

          public Tcp.Builder srcPort(TcpUdpPort srcPort)

      Sets the source port.
      Parameters:
        `srcPort` - source port
      Returns:
        this instance

    - #### seqNum

          public Tcp.Builder seqNum(long seqNum)

      Sets the sequence number.
      Parameters:
        `seqNum` - sequence number
      Returns:
        this instance

    - #### ackNum

          public Tcp.Builder ackNum(long ackNum)

      Sets the acknowledgment number.
      Parameters:
        `ackNum` - acknowledgment number
      Returns:
        this instance

    - #### flags

          public Tcp.Builder flags(int flags)

      Sets the flags.
      Parameters:
        `flags` - flag bits
      Returns:
        this instance

    - #### winSize

          public Tcp.Builder winSize(int winSize)

      Sets the window size.
      Parameters:
        `winSize` - window size
      Returns:
        this instance

    - #### urgentPtr

          public Tcp.Builder urgentPtr(int urgentPtr)

      Sets the urgent pointer.
      Parameters:
        `urgentPtr` - urgent pointer
      Returns:
        this instance

    - #### options

          public Tcp.Builder options(byte[] options)

      Sets the options.
      Parameters:
        `options` - options byte array
      Returns:
        this instance

Copyright © 2014. All Rights Reserved.