Class SentBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instances.network.instance.protocols.protocol.bgp.neighbors.neighbor.state.messages.SentBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<Sent>
,org.opendaylight.yangtools.concepts.CheckedBuilder<Sent,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class SentBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Sent>
Class that buildsSentBuilder
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:
SentBuilder createTarget(int fooXyzzy, int barBaz) { return new SentBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of SentBuilder, 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:
SentBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description SentBuilder()
SentBuilder(BgpCountersMessageTypesCommon arg)
SentBuilder(BgpNeighborMessageCountersSentState arg)
SentBuilder(Sent base)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SentBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Sent>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Sent> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Sent>>
E$$augmentation(Class<E$$> augmentationType)
Sent
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.org.opendaylight.yangtools.yang.common.Uint64
getNOTIFICATION()
org.opendaylight.yangtools.yang.common.Uint64
getUPDATE()
SentBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Sent>> augmentationType)
SentBuilder
setNOTIFICATION(BigInteger value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setNOTIFICATION(Uint64)} instead.SentBuilder
setNOTIFICATION(org.opendaylight.yangtools.yang.common.Uint64 value)
SentBuilder
setUPDATE(BigInteger value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setUPDATE(Uint64)} instead.SentBuilder
setUPDATE(org.opendaylight.yangtools.yang.common.Uint64 value)
-
-
-
Constructor Detail
-
SentBuilder
public SentBuilder()
-
SentBuilder
public SentBuilder(BgpNeighborMessageCountersSentState arg)
-
SentBuilder
public SentBuilder(BgpCountersMessageTypesCommon arg)
-
SentBuilder
public SentBuilder(Sent base)
-
-
Method Detail
-
fieldsFrom
public void fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument. Valid argument is instance of one of following types:- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.BgpNeighborMessageCountersSentState
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.BgpCountersMessageTypesCommon
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getNOTIFICATION
public org.opendaylight.yangtools.yang.common.Uint64 getNOTIFICATION()
-
getUPDATE
public org.opendaylight.yangtools.yang.common.Uint64 getUPDATE()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Sent>> E$$ augmentation(Class<E$$> augmentationType)
-
setNOTIFICATION
public SentBuilder setNOTIFICATION(org.opendaylight.yangtools.yang.common.Uint64 value)
-
setNOTIFICATION
@Deprecated(forRemoval=true) public SentBuilder setNOTIFICATION(BigInteger value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setNOTIFICATION(Uint64)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setUPDATE
public SentBuilder setUPDATE(org.opendaylight.yangtools.yang.common.Uint64 value)
-
setUPDATE
@Deprecated(forRemoval=true) public SentBuilder setUPDATE(BigInteger value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setUPDATE(Uint64)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
addAugmentation
public SentBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Sent>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Sent> augmentationValue)
-
removeAugmentation
public SentBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Sent>> augmentationType)
-
build
public Sent build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<Sent>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<Sent,IllegalArgumentException>
-
-