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>
@Generated("mdsal-binding-generator") 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 Deprecated Methods Modifier and Type Method Description BgpAfIpv4VpnInstanceBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance> augmentation)
Add an augmentation to this builder's product.<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.java.lang.Boolean
getAutoFrr()
BgpPeers
getBgpPeers()
RouterId
getRouterId()
java.lang.String
getVpnInstanceName()
java.lang.Boolean
isAutoFrr()
Deprecated, for removal: This API element is subject to removal in a future version.BgpAfIpv4VpnInstanceKey
key()
BgpAfIpv4VpnInstanceBuilder
removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> augmentationType)
Remove an augmentation from this builder's product.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 or has property with incompatible value
-
key
public BgpAfIpv4VpnInstanceKey key()
-
getAutoFrr
public java.lang.Boolean getAutoFrr()
-
isAutoFrr
@Deprecated(forRemoval=true) public final java.lang.Boolean isAutoFrr()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getBgpPeers
public BgpPeers getBgpPeers()
-
getRouterId
public RouterId getRouterId()
-
getVpnInstanceName
public java.lang.String getVpnInstanceName()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
withKey
public BgpAfIpv4VpnInstanceBuilder withKey(BgpAfIpv4VpnInstanceKey key)
-
setAutoFrr
public BgpAfIpv4VpnInstanceBuilder setAutoFrr(java.lang.Boolean value)
-
setBgpPeers
public BgpAfIpv4VpnInstanceBuilder setBgpPeers(BgpPeers value)
-
setRouterId
public BgpAfIpv4VpnInstanceBuilder setRouterId(RouterId value)
-
setVpnInstanceName
public BgpAfIpv4VpnInstanceBuilder setVpnInstanceName(java.lang.String value)
-
addAugmentation
public BgpAfIpv4VpnInstanceBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance> augmentation)
Add an augmentation to this builder's product.- Parameters:
augmentation
- augmentation to be added- Returns:
- this builder
- Throws:
java.lang.NullPointerException
- ifaugmentation
is null
-
removeAugmentation
public BgpAfIpv4VpnInstanceBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpAfIpv4VpnInstance>> 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 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>
-
-