Class CountersBuilder

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

    @Generated("mdsal-binding-generator")
    public class CountersBuilder
    extends Object
    implements org.opendaylight.yangtools.concepts.Builder<Counters>
    Class that builds Counters 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:

       
         Counters createCounters(int fooXyzzy, int barBaz) {
             return new CountersBuilder()
                 .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
                 .setBar(new BarBuilder().setBaz(barBaz).build())
                 .build();
         }
       
     

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

      • CountersBuilder

        public CountersBuilder()
      • CountersBuilder

        public CountersBuilder​(Counters base)
    • Method Detail

      • getInBroadcastPkts

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getInBroadcastPkts()
      • getInDiscards

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getInDiscards()
      • getInErrors

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getInErrors()
      • getInMulticastPkts

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getInMulticastPkts()
      • getInOctets

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getInOctets()
      • getInUnicastPkts

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getInUnicastPkts()
      • getInUnknownProtos

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32 getInUnknownProtos()
      • getLastClear

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime getLastClear()
      • getOutBroadcastPkts

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getOutBroadcastPkts()
      • getOutDiscards

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getOutDiscards()
      • getOutErrors

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getOutErrors()
      • getOutMulticastPkts

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getOutMulticastPkts()
      • getOutOctets

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getOutOctets()
      • getOutUnicastPkts

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 getOutUnicastPkts()
      • augmentation

        public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Counters>> E$$ augmentation​(Class<E$$> augmentationType)
      • setInBroadcastPkts

        public CountersBuilder setInBroadcastPkts​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setInDiscards

        public CountersBuilder setInDiscards​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setInErrors

        public CountersBuilder setInErrors​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setInMulticastPkts

        public CountersBuilder setInMulticastPkts​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setInOctets

        public CountersBuilder setInOctets​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setInUnicastPkts

        public CountersBuilder setInUnicastPkts​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setInUnknownProtos

        public CountersBuilder setInUnknownProtos​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32 value)
      • setLastClear

        public CountersBuilder setLastClear​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime value)
      • setOutBroadcastPkts

        public CountersBuilder setOutBroadcastPkts​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setOutDiscards

        public CountersBuilder setOutDiscards​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setOutErrors

        public CountersBuilder setOutErrors​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setOutMulticastPkts

        public CountersBuilder setOutMulticastPkts​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setOutOctets

        public CountersBuilder setOutOctets​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • setOutUnicastPkts

        public CountersBuilder setOutUnicastPkts​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64 value)
      • addAugmentation

        public CountersBuilder addAugmentation​(org.opendaylight.yangtools.yang.binding.Augmentation<Counters> 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 CountersBuilder removeAugmentation​(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Counters>> 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 Counters build()
        Specified by:
        build in interface org.opendaylight.yangtools.concepts.Builder<Counters>
        Specified by:
        build in interface org.opendaylight.yangtools.concepts.CheckedBuilder<Counters,​IllegalArgumentException>