Class LspaBuilder


  • @Generated("mdsal-binding-generator")
    public class LspaBuilder
    extends Object
    Class that builds Lspa 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:

       
         Lspa createLspa(int fooXyzzy, int barBaz) {
             return new LspaBuilder()
                 .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
                 .setBar(new BarBuilder().setBaz(barBaz).build())
                 .build();
         }
       
     

    This pattern is supported by the immutable nature of Lspa, 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 opportunities, 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:
    Lspa
    • Constructor Detail

      • LspaBuilder

        public LspaBuilder()
        Construct an empty builder.
      • LspaBuilder

        public LspaBuilder​(Object arg)
        Construct a new builder initialized from specified Object.
        Parameters:
        arg - Object from which the builder should be initialized
      • LspaBuilder

        public LspaBuilder​(ObjectHeader arg)
        Construct a new builder initialized from specified ObjectHeader.
        Parameters:
        arg - ObjectHeader from which the builder should be initialized
      • LspaBuilder

        public LspaBuilder​(TunnelAttributes arg)
        Construct a new builder initialized from specified TunnelAttributes.
        Parameters:
        arg - TunnelAttributes from which the builder should be initialized
      • LspaBuilder

        public LspaBuilder​(Priority arg)
        Construct a new builder initialized from specified Priority.
        Parameters:
        arg - Priority from which the builder should be initialized
      • LspaBuilder

        public LspaBuilder​(AttributeFilters arg)
        Construct a new builder initialized from specified AttributeFilters.
        Parameters:
        arg - AttributeFilters from which the builder should be initialized
      • LspaBuilder

        public LspaBuilder​(Lspa base)
        Construct a builder initialized with state from specified Lspa.
        Parameters:
        base - Lspa from which the builder should be initialized
    • Method Detail

      • getHoldPriority

        public org.opendaylight.yangtools.yang.common.Uint8 getHoldPriority()
        Return current value associated with the property corresponding to Priority.getHoldPriority().
        Returns:
        current value
      • getIgnore

        public Boolean getIgnore()
        Return current value associated with the property corresponding to ObjectHeader.getIgnore().
        Returns:
        current value
      • getSetupPriority

        public org.opendaylight.yangtools.yang.common.Uint8 getSetupPriority()
        Return current value associated with the property corresponding to Priority.getSetupPriority().
        Returns:
        current value
      • getTlvs

        public Tlvs getTlvs()
        Return current value associated with the property corresponding to Lspa.getTlvs().
        Returns:
        current value
      • augmentation

        public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Lspa>> E$$ augmentation​(Class<E$$> augmentationType)
        Return the specified augmentation, if it is present in this builder.
        Type Parameters:
        E$$ - augmentation type
        Parameters:
        augmentationType - augmentation type class
        Returns:
        Augmentation object from this builder, or null if not present
        Throws:
        NullPointerException - if augmentType is null
      • setHoldPriority

        public LspaBuilder setHoldPriority​(org.opendaylight.yangtools.yang.common.Uint8 value)
        Set the property corresponding to Priority.getHoldPriority() to the specified value.
        Parameters:
        value - desired value
        Returns:
        this builder
      • setSetupPriority

        public LspaBuilder setSetupPriority​(org.opendaylight.yangtools.yang.common.Uint8 value)
        Set the property corresponding to Priority.getSetupPriority() to the specified value.
        Parameters:
        value - desired value
        Returns:
        this builder
      • setTlvs

        public LspaBuilder setTlvs​(Tlvs value)
        Set the property corresponding to Lspa.getTlvs() to the specified value.
        Parameters:
        value - desired value
        Returns:
        this builder
      • addAugmentation

        public LspaBuilder addAugmentation​(org.opendaylight.yangtools.yang.binding.Augmentation<Lspa> augmentation)
        Add an augmentation to this builder's product.
        Parameters:
        augmentation - augmentation to be added
        Returns:
        this builder
        Throws:
        NullPointerException - if augmentation is null
      • removeAugmentation

        public LspaBuilder removeAugmentation​(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Lspa>> augmentationType)
        Remove an augmentation from this builder's product. If this builder does not track such an augmentation type, this method does nothing.
        Parameters:
        augmentationType - augmentation type to be removed
        Returns:
        this builder
      • build

        public @NonNull Lspa build()
        A new Lspa instance.
        Returns:
        A new Lspa instance.