Class NetworksBuilder

  • All Implemented Interfaces:
    org.opendaylight.yangtools.concepts.Builder<Networks>, org.opendaylight.yangtools.concepts.CheckedBuilder<Networks,​java.lang.IllegalArgumentException>, org.opendaylight.yangtools.concepts.Mutable, org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>

    public class NetworksBuilder
    extends java.lang.Object
    implements org.opendaylight.yangtools.concepts.Builder<Networks>
    Class that builds NetworksBuilder instances. Overall design of the class is that of a fluent interface, where method chaining is used.

    In general, this class is supposed to be used like this template:

       
         NetworksBuilder createTarget(int fooXyzzy, int barBaz) {
             return new NetworksBuilderBuilder()
                 .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
                 .setBar(new BarBuilder().setBaz(barBaz).build())
                 .build();
         }
       
     

    This pattern is supported by the immutable nature of NetworksBuilder, as instances can be freely passed around without worrying about synchronization issues.

    As a side note: method chaining results in:

    • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is on the stack, so further method invocations just need to fill method arguments for the next method invocation, which is terminated by build(), which is then returned from the method
    • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is very localized
    • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than method) stack, making escape analysis a lot easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely eliminated
    See Also:
    NetworksBuilder, Builder
    • Constructor Detail

      • NetworksBuilder

        public NetworksBuilder()
      • NetworksBuilder

        public NetworksBuilder​(Networks base)
    • Method Detail

      • getAfi

        public org.opendaylight.yangtools.yang.common.Uint32 getAfi()
      • getEncapType

        public EncapType getEncapType()
      • getEsi

        public java.lang.String getEsi()
      • getEthtag

        public org.opendaylight.yangtools.yang.common.Uint32 getEthtag()
      • getL2vni

        public org.opendaylight.yangtools.yang.common.Uint32 getL2vni()
      • getL3vni

        public org.opendaylight.yangtools.yang.common.Uint32 getL3vni()
      • getLabel

        public org.opendaylight.yangtools.yang.common.Uint32 getLabel()
      • getMacaddress

        public java.lang.String getMacaddress()
      • getNexthop

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address getNexthop()
      • getPrefixLen

        public java.lang.String getPrefixLen()
      • getRd

        public java.lang.String getRd()
      • getRoutermac

        public java.lang.String getRoutermac()
      • augmentation

        public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Networks>> E$$ augmentation​(java.lang.Class<E$$> augmentationType)
      • setAfi

        public NetworksBuilder setAfi​(org.opendaylight.yangtools.yang.common.Uint32 value)
      • setAfi

        @Deprecated(forRemoval=true)
        public NetworksBuilder setAfi​(java.lang.Long value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use {#link setAfi(Uint32)} instead.
        Utility migration setter.
        Parameters:
        value - field value in legacy type
        Returns:
        this builder
      • setEthtag

        public NetworksBuilder setEthtag​(org.opendaylight.yangtools.yang.common.Uint32 value)
      • setEthtag

        @Deprecated(forRemoval=true)
        public NetworksBuilder setEthtag​(java.lang.Long value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use {#link setEthtag(Uint32)} instead.
        Utility migration setter.
        Parameters:
        value - field value in legacy type
        Returns:
        this builder
      • setL2vni

        public NetworksBuilder setL2vni​(org.opendaylight.yangtools.yang.common.Uint32 value)
      • setL2vni

        @Deprecated(forRemoval=true)
        public NetworksBuilder setL2vni​(java.lang.Long value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use {#link setL2vni(Uint32)} instead.
        Utility migration setter.
        Parameters:
        value - field value in legacy type
        Returns:
        this builder
      • setL3vni

        public NetworksBuilder setL3vni​(org.opendaylight.yangtools.yang.common.Uint32 value)
      • setL3vni

        @Deprecated(forRemoval=true)
        public NetworksBuilder setL3vni​(java.lang.Long value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use {#link setL3vni(Uint32)} instead.
        Utility migration setter.
        Parameters:
        value - field value in legacy type
        Returns:
        this builder
      • setLabel

        public NetworksBuilder setLabel​(org.opendaylight.yangtools.yang.common.Uint32 value)
      • setLabel

        @Deprecated(forRemoval=true)
        public NetworksBuilder setLabel​(java.lang.Long value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use {#link setLabel(Uint32)} instead.
        Utility migration setter.
        Parameters:
        value - field value in legacy type
        Returns:
        this builder
      • setMacaddress

        public NetworksBuilder setMacaddress​(java.lang.String value)
      • setNexthop

        public NetworksBuilder setNexthop​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address value)
      • setPrefixLen

        public NetworksBuilder setPrefixLen​(java.lang.String value)
      • setRoutermac

        public NetworksBuilder setRoutermac​(java.lang.String value)
      • addAugmentation

        public NetworksBuilder addAugmentation​(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Networks>> augmentationType,
                                               org.opendaylight.yangtools.yang.binding.Augmentation<Networks> augmentationValue)
      • removeAugmentation

        public NetworksBuilder removeAugmentation​(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Networks>> augmentationType)
      • build

        public Networks build()
        Specified by:
        build in interface org.opendaylight.yangtools.concepts.Builder<Networks>
        Specified by:
        build in interface org.opendaylight.yangtools.concepts.CheckedBuilder<Networks,​java.lang.IllegalArgumentException>