Package org.opendaylight.yang.gen.v1.http.openconfig.net.yang.interfaces.rev210406._interface.counters.state
Class CountersBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.interfaces.rev210406._interface.counters.state.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 buildsCountersinstances. 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 Summary
Constructors Constructor Description CountersBuilder()CountersBuilder(Counters base)
-
Method Summary
-
-
-
Constructor Detail
-
CountersBuilder
public CountersBuilder()
-
CountersBuilder
public CountersBuilder(Counters base)
-
-
Method Detail
-
getCarrierTransitions
public Counter64 getCarrierTransitions()
-
getInBroadcastPkts
public Counter64 getInBroadcastPkts()
-
getInDiscards
public Counter64 getInDiscards()
-
getInErrors
public Counter64 getInErrors()
-
getInFcsErrors
public Counter64 getInFcsErrors()
-
getInMulticastPkts
public Counter64 getInMulticastPkts()
-
getInOctets
public Counter64 getInOctets()
-
getInPkts
public Counter64 getInPkts()
-
getInUnicastPkts
public Counter64 getInUnicastPkts()
-
getInUnknownProtos
public Counter64 getInUnknownProtos()
-
getLastClear
public Timeticks64 getLastClear()
-
getOutBroadcastPkts
public Counter64 getOutBroadcastPkts()
-
getOutDiscards
public Counter64 getOutDiscards()
-
getOutErrors
public Counter64 getOutErrors()
-
getOutMulticastPkts
public Counter64 getOutMulticastPkts()
-
getOutOctets
public Counter64 getOutOctets()
-
getOutPkts
public Counter64 getOutPkts()
-
getOutUnicastPkts
public Counter64 getOutUnicastPkts()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Counters>> E$$ augmentation(Class<E$$> augmentationType)
-
setCarrierTransitions
public CountersBuilder setCarrierTransitions(Counter64 value)
-
setInBroadcastPkts
public CountersBuilder setInBroadcastPkts(Counter64 value)
-
setInDiscards
public CountersBuilder setInDiscards(Counter64 value)
-
setInErrors
public CountersBuilder setInErrors(Counter64 value)
-
setInFcsErrors
public CountersBuilder setInFcsErrors(Counter64 value)
-
setInMulticastPkts
public CountersBuilder setInMulticastPkts(Counter64 value)
-
setInOctets
public CountersBuilder setInOctets(Counter64 value)
-
setInPkts
public CountersBuilder setInPkts(Counter64 value)
-
setInUnicastPkts
public CountersBuilder setInUnicastPkts(Counter64 value)
-
setInUnknownProtos
public CountersBuilder setInUnknownProtos(Counter64 value)
-
setLastClear
public CountersBuilder setLastClear(Timeticks64 value)
-
setOutBroadcastPkts
public CountersBuilder setOutBroadcastPkts(Counter64 value)
-
setOutDiscards
public CountersBuilder setOutDiscards(Counter64 value)
-
setOutErrors
public CountersBuilder setOutErrors(Counter64 value)
-
setOutMulticastPkts
public CountersBuilder setOutMulticastPkts(Counter64 value)
-
setOutOctets
public CountersBuilder setOutOctets(Counter64 value)
-
setOutPkts
public CountersBuilder setOutPkts(Counter64 value)
-
setOutUnicastPkts
public CountersBuilder setOutUnicastPkts(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- ifaugmentationis 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:
buildin interfaceorg.opendaylight.yangtools.concepts.Builder<Counters>- Specified by:
buildin interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<Counters,IllegalArgumentException>
-
-