Class BgpAfIpv4VpnInstanceBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.bgp.router.bgp.af.ipv4.vpn.instances.BgpAfIpv4VpnInstanceBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<BgpAfIpv4VpnInstance>
,org.opendaylight.yangtools.concepts.CheckedBuilder<BgpAfIpv4VpnInstance,java.lang.IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class BgpAfIpv4VpnInstanceBuilder extends java.lang.Object implements org.opendaylight.yangtools.concepts.Builder<BgpAfIpv4VpnInstance>
Class that buildsBgpAfIpv4VpnInstanceBuilder
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:
BgpAfIpv4VpnInstanceBuilder createTarget(int fooXyzzy, int barBaz) { return new BgpAfIpv4VpnInstanceBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of BgpAfIpv4VpnInstanceBuilder, 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:
BgpAfIpv4VpnInstanceBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description BgpAfIpv4VpnInstanceBuilder()
BgpAfIpv4VpnInstanceBuilder(BgpAfIpv4VpnInstance base)
BgpAfIpv4VpnInstanceBuilder(BgpAfVpnInstanceConfig arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BgpAfIpv4VpnInstanceBuilder
addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>>
E$$augmentation(java.lang.Class<E$$> augmentationType)
BgpAfIpv4VpnInstance
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.BgpPeers
getBgpPeers()
RouterId
getRouterId()
java.lang.String
getVpnInstanceName()
java.lang.Boolean
isAutoFrr()
BgpAfIpv4VpnInstanceKey
key()
BgpAfIpv4VpnInstanceBuilder
removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> augmentationType)
BgpAfIpv4VpnInstanceBuilder
setAutoFrr(java.lang.Boolean value)
BgpAfIpv4VpnInstanceBuilder
setBgpPeers(BgpPeers value)
BgpAfIpv4VpnInstanceBuilder
setRouterId(RouterId value)
BgpAfIpv4VpnInstanceBuilder
setVpnInstanceName(java.lang.String value)
BgpAfIpv4VpnInstanceBuilder
withKey(BgpAfIpv4VpnInstanceKey key)
-
-
-
Constructor Detail
-
BgpAfIpv4VpnInstanceBuilder
public BgpAfIpv4VpnInstanceBuilder()
-
BgpAfIpv4VpnInstanceBuilder
public BgpAfIpv4VpnInstanceBuilder(BgpAfVpnInstanceConfig arg)
-
BgpAfIpv4VpnInstanceBuilder
public BgpAfIpv4VpnInstanceBuilder(BgpAfIpv4VpnInstance 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.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.BgpAfVpnInstanceConfig
- Parameters:
arg
- grouping object- Throws:
java.lang.IllegalArgumentException
- if given argument is none of valid types
-
key
public BgpAfIpv4VpnInstanceKey key()
-
getBgpPeers
public BgpPeers getBgpPeers()
-
getRouterId
public RouterId getRouterId()
-
getVpnInstanceName
public java.lang.String getVpnInstanceName()
-
isAutoFrr
public java.lang.Boolean isAutoFrr()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
withKey
public BgpAfIpv4VpnInstanceBuilder withKey(BgpAfIpv4VpnInstanceKey key)
-
setBgpPeers
public BgpAfIpv4VpnInstanceBuilder setBgpPeers(BgpPeers value)
-
setRouterId
public BgpAfIpv4VpnInstanceBuilder setRouterId(RouterId value)
-
setVpnInstanceName
public BgpAfIpv4VpnInstanceBuilder setVpnInstanceName(java.lang.String value)
-
setAutoFrr
public BgpAfIpv4VpnInstanceBuilder setAutoFrr(java.lang.Boolean value)
-
addAugmentation
public BgpAfIpv4VpnInstanceBuilder addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance> augmentationValue)
-
removeAugmentation
public BgpAfIpv4VpnInstanceBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> augmentationType)
-
build
public BgpAfIpv4VpnInstance build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<BgpAfIpv4VpnInstance>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<BgpAfIpv4VpnInstance,java.lang.IllegalArgumentException>
-
-