com.h3c.util.pkt

## Class Ethernet.Builder

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

- Enclosing class:
    Ethernet

      public static class Ethernet.Builder
      extends Object

  Builder (mutable) used to create new protocol instances.

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Ethernet` | `build()` Creates a new protocol instance from this builder.
    `Ethernet.Builder` | `control(Ethernet.Control control)` Sets the 802.3 control type.
    `Ethernet.Builder` | `dsap(Ethernet.Dsap dsap)` Sets the destination service access point.
    `Ethernet.Builder` | `dstAddr(MacAddress dstAddr)` Sets the destination address.
    `Ethernet.Builder` | `snapId(Ethernet.SnapId snapId)` Sets the SNAP ID.
    `Ethernet.Builder` | `srcAddr(MacAddress srcAddr)` Sets the source address.
    `Ethernet.Builder` | `ssap(Ethernet.Ssap ssap)` Sets the source service access point.
    `Ethernet.Builder` | `type(EthernetType type)` Sets the ethernet type.
    `Ethernet.Builder` | `vlanDei(boolean vlanDei)` Sets the VLAN Drop Eligibility Indicator flag.
    `Ethernet.Builder` | `vlanId(int vlanId)` Sets the VLAN ID.
    `Ethernet.Builder` | `vlanPriority(Ethernet.VlanPriority vlanPriority)` Sets the VLAN priority.

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

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

- - ### Constructor Detail

    - #### Ethernet.Builder

          public Ethernet.Builder()

      Create a new builder using the defaults:

           type = IPv4 (NONE indicates 802.3 Snap)
           vlanId = 0 (0 < indicates 802.1Q VLAN ID)
           vlanPriority = PRIORITY_1
           dsap = NO_DSAP
           ssap = NO_SSAP
           control = NO_CONTROL
           snapId = NO_SNAP_ID

    - #### Ethernet.Builder

          public Ethernet.Builder(Ethernet eth)

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

  - ### Method Detail

    - #### build

          public Ethernet build()

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

    - #### dstAddr

          public Ethernet.Builder dstAddr(MacAddress dstAddr)

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

    - #### srcAddr

          public Ethernet.Builder srcAddr(MacAddress srcAddr)

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

    - #### type

          public Ethernet.Builder type(EthernetType type)

      Sets the ethernet type. A value of `Ethernet.NONE` indicates an 802.3 encoding.
      Parameters:
        `type` - ethernet type
      Returns:
        this instance

    - #### vlanId

          public Ethernet.Builder vlanId(int vlanId)

      Sets the VLAN ID. A value > 0 indicates 802.1Q encoding.
      Parameters:
        `vlanId` - VLAN ID
      Returns:
        this instance

    - #### vlanDei

          public Ethernet.Builder vlanDei(boolean vlanDei)

      Sets the VLAN Drop Eligibility Indicator flag.
      Parameters:
        `vlanDei` - VLAN DEI flag value
      Returns:
        this instance

    - #### vlanPriority

          public Ethernet.Builder vlanPriority(Ethernet.VlanPriority vlanPriority)

      Sets the VLAN priority.
      Parameters:
        `vlanPriority` - VLAN priority
      Returns:
        this instance

    - #### dsap

          public Ethernet.Builder dsap(Ethernet.Dsap dsap)

      Sets the destination service access point.
      Parameters:
        `dsap` - destination service access point.
      Returns:
        this instance

    - #### ssap

          public Ethernet.Builder ssap(Ethernet.Ssap ssap)

      Sets the source service access point.
      Parameters:
        `ssap` - source service access point.
      Returns:
        this instance

    - #### control

          public Ethernet.Builder control(Ethernet.Control control)

      Sets the 802.3 control type.
      Parameters:
        `control` - 802.3 control type
      Returns:
        this instance

    - #### snapId

          public Ethernet.Builder snapId(Ethernet.SnapId snapId)

      Sets the SNAP ID.
      Parameters:
        `snapId` - SNAP ID
      Returns:
        this instance

Copyright © 2014. All Rights Reserved.