com.h3c.util.pkt

## Class IpV6.Builder

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

- Enclosing class:
    IpV6

      public static class IpV6.Builder
      extends Object

  Builder (mutable) used to create new protocol instances.

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IpV6` | `build()` Creates a new protocol instance from this builder.
    `IpV6.Builder` | `dstAddr(IpAddress dstAddr)` Sets the destination address.
    `IpV6.Builder` | `flowLabel(int flowLabel)` Sets the flow label.
    `IpV6.Builder` | `hopLimit(int hopLimit)` Sets the hop limit.
    `IpV6.Builder` | `nextHdr(IpType nextHdr)` Sets the next header field which could be a IPv6 extension option or the next protocol layer.
    `IpV6.Builder` | `options(IpV6.Option[] options)` Sets the options.
    `IpV6.Builder` | `srcAddr(IpAddress srcAddr)` Sets the source address.
    `IpV6.Builder` | `tosDsfc(IpTosDsfc tosDsfc)` Sets the TOS Differentiated Services Field Codepoints (DSFC) type.
    `IpV6.Builder` | `tosEcn(IpTosEcn tosEcn)` Sets the TOS Explicit Congestion Notification (ECN) type.

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

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

- - ### Constructor Detail

    - #### IpV6.Builder

          public IpV6.Builder()

      Create a new builder using the defaults:

           tosDsfc = IpTosDsfc.CS0
           tosEcn = IpTosEcn.NOT_ECT
           options = NO_OPTIONS

    - #### IpV6.Builder

          public IpV6.Builder(IpV6 ip)

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

  - ### Method Detail

    - #### build

          public IpV6 build()

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

    - #### tosDsfc

          public IpV6.Builder tosDsfc(IpTosDsfc tosDsfc)

      Sets the TOS Differentiated Services Field Codepoints (DSFC) type.
      Parameters:
        `tosDsfc` - TOS DSFC type
      Returns:
        this instance

    - #### tosEcn

          public IpV6.Builder tosEcn(IpTosEcn tosEcn)

      Sets the TOS Explicit Congestion Notification (ECN) type.
      Parameters:
        `tosEcn` - TOS ECN type
      Returns:
        this instance

    - #### flowLabel

          public IpV6.Builder flowLabel(int flowLabel)

      Sets the flow label.
      Parameters:
        `flowLabel` - flow label
      Returns:
        this instance

    - #### nextHdr

          public IpV6.Builder nextHdr(IpType nextHdr)

      Sets the next header field which could be a IPv6 extension option or the next protocol layer.
      Parameters:
        `nextHdr` - next header protocol type
      Returns:
        this instance

    - #### hopLimit

          public IpV6.Builder hopLimit(int hopLimit)

      Sets the hop limit.
      Parameters:
        `hopLimit` - hop limit
      Returns:
        this instance

    - #### srcAddr

          public IpV6.Builder srcAddr(IpAddress srcAddr)

      Sets the source address.
      Parameters:
        `srcAddr` - source address
      Returns:
        this instance

    - #### dstAddr

          public IpV6.Builder dstAddr(IpAddress dstAddr)

      Sets the destination address.
      Parameters:
        `dstAddr` - destination address
      Returns:
        this instance

    - #### options

          public IpV6.Builder options(IpV6.Option[] options)

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

Copyright © 2014. All Rights Reserved.