Class AfiSafiBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder
Class that builds
AfiSafi
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:
AfiSafi createAfiSafi(int fooXyzzy, int barBaz) {
return new AfiSafiBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of AfiSafi, 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:
-
Constructor Summary
ConstructorDescriptionConstruct an empty builder.AfiSafiBuilder
(AfiSafi base) Construct a builder initialized with state from specifiedAfiSafi
.Construct a new builder initialized from specifiedIpv4LabelledUnicastGroup
.Construct a new builder initialized from specifiedIpv4UnicastGroup
.Construct a new builder initialized from specifiedIpv6LabelledUnicastGroup
.Construct a new builder initialized from specifiedIpv6UnicastGroup
.Construct a new builder initialized from specifiedL2vpnEvpnGroup
.Construct a new builder initialized from specifiedL2vpnVplsGroup
.Construct a new builder initialized from specifiedL3vpnIpv4MulticastGroup
.Construct a new builder initialized from specifiedL3vpnIpv4UnicastGroup
.Construct a new builder initialized from specifiedL3vpnIpv6MulticastGroup
.Construct a new builder initialized from specifiedL3vpnIpv6UnicastGroup
.Construct a new builder initialized from specifiedApplyPolicyGroup
. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation
(org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi>>
E$$augmentation
(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.@NonNull AfiSafi
build()
A newAfiSafi
instance.void
fieldsFrom
(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.Return current value associated with the property corresponding toAfiSafi.getAfiSafiName()
.Return current value associated with the property corresponding toApplyPolicyGroup.getApplyPolicy()
.Return current value associated with the property corresponding toAfiSafi.getConfig()
.Return current value associated with the property corresponding toAfiSafi.getGracefulRestart()
.Return current value associated with the property corresponding toIpv4LabelledUnicastGroup.getIpv4LabelledUnicast()
.Return current value associated with the property corresponding toIpv4UnicastGroup.getIpv4Unicast()
.Return current value associated with the property corresponding toIpv6LabelledUnicastGroup.getIpv6LabelledUnicast()
.Return current value associated with the property corresponding toIpv6UnicastGroup.getIpv6Unicast()
.Return current value associated with the property corresponding toL2vpnEvpnGroup.getL2vpnEvpn()
.Return current value associated with the property corresponding toL2vpnVplsGroup.getL2vpnVpls()
.Return current value associated with the property corresponding toL3vpnIpv4MulticastGroup.getL3vpnIpv4Multicast()
.Return current value associated with the property corresponding toL3vpnIpv4UnicastGroup.getL3vpnIpv4Unicast()
.Return current value associated with the property corresponding toL3vpnIpv6MulticastGroup.getL3vpnIpv6Multicast()
.Return current value associated with the property corresponding toL3vpnIpv6UnicastGroup.getL3vpnIpv6Unicast()
.getState()
Return current value associated with the property corresponding toAfiSafi.getState()
.key()
Return current value associated with the property corresponding toAfiSafi.key()
.removeAugmentation
(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi>> augmentationType) Remove an augmentation from this builder's product.setAfiSafiName
(AfiSafiType value) Set the property corresponding toAfiSafi.getAfiSafiName()
to the specified value.setApplyPolicy
(ApplyPolicy value) Set the property corresponding toApplyPolicyGroup.getApplyPolicy()
to the specified value.Set the property corresponding toAfiSafi.getConfig()
to the specified value.Set the property corresponding toAfiSafi.getGracefulRestart()
to the specified value.Set the property corresponding toIpv4LabelledUnicastGroup.getIpv4LabelledUnicast()
to the specified value.setIpv4Unicast
(Ipv4Unicast value) Set the property corresponding toIpv4UnicastGroup.getIpv4Unicast()
to the specified value.Set the property corresponding toIpv6LabelledUnicastGroup.getIpv6LabelledUnicast()
to the specified value.setIpv6Unicast
(Ipv6Unicast value) Set the property corresponding toIpv6UnicastGroup.getIpv6Unicast()
to the specified value.setL2vpnEvpn
(L2vpnEvpn value) Set the property corresponding toL2vpnEvpnGroup.getL2vpnEvpn()
to the specified value.setL2vpnVpls
(L2vpnVpls value) Set the property corresponding toL2vpnVplsGroup.getL2vpnVpls()
to the specified value.Set the property corresponding toL3vpnIpv4MulticastGroup.getL3vpnIpv4Multicast()
to the specified value.Set the property corresponding toL3vpnIpv4UnicastGroup.getL3vpnIpv4Unicast()
to the specified value.Set the property corresponding toL3vpnIpv6MulticastGroup.getL3vpnIpv6Multicast()
to the specified value.Set the property corresponding toL3vpnIpv6UnicastGroup.getL3vpnIpv6Unicast()
to the specified value.Set the property corresponding toAfiSafi.getState()
to the specified value.withKey
(AfiSafiKey key) Set the key value corresponding toAfiSafi.key()
to the specified value.
-
Constructor Details
-
AfiSafiBuilder
public AfiSafiBuilder()Construct an empty builder. -
AfiSafiBuilder
Construct a new builder initialized from specifiedApplyPolicyGroup
.- Parameters:
arg
- ApplyPolicyGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedIpv4UnicastGroup
.- Parameters:
arg
- Ipv4UnicastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedIpv6UnicastGroup
.- Parameters:
arg
- Ipv6UnicastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedIpv4LabelledUnicastGroup
.- Parameters:
arg
- Ipv4LabelledUnicastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedIpv6LabelledUnicastGroup
.- Parameters:
arg
- Ipv6LabelledUnicastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedL3vpnIpv4UnicastGroup
.- Parameters:
arg
- L3vpnIpv4UnicastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedL3vpnIpv6UnicastGroup
.- Parameters:
arg
- L3vpnIpv6UnicastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedL3vpnIpv4MulticastGroup
.- Parameters:
arg
- L3vpnIpv4MulticastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedL3vpnIpv6MulticastGroup
.- Parameters:
arg
- L3vpnIpv6MulticastGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedL2vpnVplsGroup
.- Parameters:
arg
- L2vpnVplsGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a new builder initialized from specifiedL2vpnEvpnGroup
.- Parameters:
arg
- L2vpnEvpnGroup from which the builder should be initialized
-
AfiSafiBuilder
Construct a builder initialized with state from specifiedAfiSafi
.- Parameters:
base
- AfiSafi from which the builder should be initialized
-
-
Method Details
-
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:- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
key
Return current value associated with the property corresponding toAfiSafi.key()
.- Returns:
- current value
-
getAfiSafiName
Return current value associated with the property corresponding toAfiSafi.getAfiSafiName()
.- Returns:
- current value
-
getApplyPolicy
Return current value associated with the property corresponding toApplyPolicyGroup.getApplyPolicy()
.- Returns:
- current value
-
getConfig
Return current value associated with the property corresponding toAfiSafi.getConfig()
.- Returns:
- current value
-
getGracefulRestart
Return current value associated with the property corresponding toAfiSafi.getGracefulRestart()
.- Returns:
- current value
-
getIpv4LabelledUnicast
Return current value associated with the property corresponding toIpv4LabelledUnicastGroup.getIpv4LabelledUnicast()
.- Returns:
- current value
-
getIpv4Unicast
Return current value associated with the property corresponding toIpv4UnicastGroup.getIpv4Unicast()
.- Returns:
- current value
-
getIpv6LabelledUnicast
Return current value associated with the property corresponding toIpv6LabelledUnicastGroup.getIpv6LabelledUnicast()
.- Returns:
- current value
-
getIpv6Unicast
Return current value associated with the property corresponding toIpv6UnicastGroup.getIpv6Unicast()
.- Returns:
- current value
-
getL2vpnEvpn
Return current value associated with the property corresponding toL2vpnEvpnGroup.getL2vpnEvpn()
.- Returns:
- current value
-
getL2vpnVpls
Return current value associated with the property corresponding toL2vpnVplsGroup.getL2vpnVpls()
.- Returns:
- current value
-
getL3vpnIpv4Multicast
Return current value associated with the property corresponding toL3vpnIpv4MulticastGroup.getL3vpnIpv4Multicast()
.- Returns:
- current value
-
getL3vpnIpv4Unicast
Return current value associated with the property corresponding toL3vpnIpv4UnicastGroup.getL3vpnIpv4Unicast()
.- Returns:
- current value
-
getL3vpnIpv6Multicast
Return current value associated with the property corresponding toL3vpnIpv6MulticastGroup.getL3vpnIpv6Multicast()
.- Returns:
- current value
-
getL3vpnIpv6Unicast
Return current value associated with the property corresponding toL3vpnIpv6UnicastGroup.getL3vpnIpv6Unicast()
.- Returns:
- current value
-
getState
Return current value associated with the property corresponding toAfiSafi.getState()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi>> E$$ augmentation(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.- Type Parameters:
E$$
- augmentation type- Parameters:
augmentationType
- augmentation type class- Returns:
- Augmentation object from this builder, or
null
if not present - Throws:
NullPointerException
- ifaugmentType
isnull
-
withKey
Set the key value corresponding toAfiSafi.key()
to the specified value.- Parameters:
key
- desired value- Returns:
- this builder
-
setAfiSafiName
Set the property corresponding toAfiSafi.getAfiSafiName()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setApplyPolicy
Set the property corresponding toApplyPolicyGroup.getApplyPolicy()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setConfig
Set the property corresponding toAfiSafi.getConfig()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setGracefulRestart
Set the property corresponding toAfiSafi.getGracefulRestart()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv4LabelledUnicast
Set the property corresponding toIpv4LabelledUnicastGroup.getIpv4LabelledUnicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv4Unicast
Set the property corresponding toIpv4UnicastGroup.getIpv4Unicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv6LabelledUnicast
Set the property corresponding toIpv6LabelledUnicastGroup.getIpv6LabelledUnicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv6Unicast
Set the property corresponding toIpv6UnicastGroup.getIpv6Unicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setL2vpnEvpn
Set the property corresponding toL2vpnEvpnGroup.getL2vpnEvpn()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setL2vpnVpls
Set the property corresponding toL2vpnVplsGroup.getL2vpnVpls()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setL3vpnIpv4Multicast
Set the property corresponding toL3vpnIpv4MulticastGroup.getL3vpnIpv4Multicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setL3vpnIpv4Unicast
Set the property corresponding toL3vpnIpv4UnicastGroup.getL3vpnIpv4Unicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setL3vpnIpv6Multicast
Set the property corresponding toL3vpnIpv6MulticastGroup.getL3vpnIpv6Multicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setL3vpnIpv6Unicast
Set the property corresponding toL3vpnIpv6UnicastGroup.getL3vpnIpv6Unicast()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setState
Set the property corresponding toAfiSafi.getState()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public AfiSafiBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi> augmentation) Add an augmentation to this builder's product.- Parameters:
augmentation
- augmentation to be added- Returns:
- this builder
- Throws:
NullPointerException
- ifaugmentation
is null
-
removeAugmentation
public AfiSafiBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi>> 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
A newAfiSafi
instance.- Returns:
- A new
AfiSafi
instance.
-