Class AfiSafiBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<AfiSafi>
,org.opendaylight.yangtools.concepts.CheckedBuilder<AfiSafi,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
@Generated("mdsal-binding-generator") public class AfiSafiBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<AfiSafi>
Class that buildsAfiSafi
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:
AfiSafi
,Builder
-
-
Constructor Summary
Constructors Constructor Description AfiSafiBuilder()
AfiSafiBuilder(AfiSafi base)
AfiSafiBuilder(Ipv4LabelledUnicastGroup arg)
AfiSafiBuilder(Ipv4UnicastGroup arg)
AfiSafiBuilder(Ipv6LabelledUnicastGroup arg)
AfiSafiBuilder(Ipv6UnicastGroup arg)
AfiSafiBuilder(L2vpnEvpnGroup arg)
AfiSafiBuilder(L2vpnVplsGroup arg)
AfiSafiBuilder(L3vpnIpv4MulticastGroup arg)
AfiSafiBuilder(L3vpnIpv4UnicastGroup arg)
AfiSafiBuilder(L3vpnIpv6MulticastGroup arg)
AfiSafiBuilder(L3vpnIpv6UnicastGroup arg)
AfiSafiBuilder(ApplyPolicyGroup arg)
-
Method Summary
-
-
-
Constructor Detail
-
AfiSafiBuilder
public AfiSafiBuilder()
-
AfiSafiBuilder
public AfiSafiBuilder(ApplyPolicyGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(Ipv4UnicastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(Ipv6UnicastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(Ipv4LabelledUnicastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(Ipv6LabelledUnicastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(L3vpnIpv4UnicastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(L3vpnIpv6UnicastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(L3vpnIpv4MulticastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(L3vpnIpv6MulticastGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(L2vpnVplsGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(L2vpnEvpnGroup arg)
-
AfiSafiBuilder
public AfiSafiBuilder(AfiSafi 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:- ApplyPolicyGroup
- Ipv6LabelledUnicastGroup
- Ipv4UnicastGroup
- Ipv4LabelledUnicastGroup
- L3vpnIpv4UnicastGroup
- L3vpnIpv4MulticastGroup
- L2vpnVplsGroup
- L3vpnIpv6MulticastGroup
- L2vpnEvpnGroup
- Ipv6UnicastGroup
- L3vpnIpv6UnicastGroup
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
key
public AfiSafiKey key()
-
getAfiSafiName
public Class<? extends AfiSafiType> getAfiSafiName()
-
getApplyPolicy
public ApplyPolicy getApplyPolicy()
-
getConfig
public Config getConfig()
-
getGracefulRestart
public GracefulRestart getGracefulRestart()
-
getIpv4LabelledUnicast
public Ipv4LabelledUnicast getIpv4LabelledUnicast()
-
getIpv4Unicast
public Ipv4Unicast getIpv4Unicast()
-
getIpv6LabelledUnicast
public Ipv6LabelledUnicast getIpv6LabelledUnicast()
-
getIpv6Unicast
public Ipv6Unicast getIpv6Unicast()
-
getL2vpnEvpn
public L2vpnEvpn getL2vpnEvpn()
-
getL2vpnVpls
public L2vpnVpls getL2vpnVpls()
-
getL3vpnIpv4Multicast
public L3vpnIpv4Multicast getL3vpnIpv4Multicast()
-
getL3vpnIpv4Unicast
public L3vpnIpv4Unicast getL3vpnIpv4Unicast()
-
getL3vpnIpv6Multicast
public L3vpnIpv6Multicast getL3vpnIpv6Multicast()
-
getL3vpnIpv6Unicast
public L3vpnIpv6Unicast getL3vpnIpv6Unicast()
-
getState
public State getState()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<AfiSafi>> E$$ augmentation(Class<E$$> augmentationType)
-
withKey
public AfiSafiBuilder withKey(AfiSafiKey key)
-
setAfiSafiName
public AfiSafiBuilder setAfiSafiName(Class<? extends AfiSafiType> value)
-
setApplyPolicy
public AfiSafiBuilder setApplyPolicy(ApplyPolicy value)
-
setConfig
public AfiSafiBuilder setConfig(Config value)
-
setGracefulRestart
public AfiSafiBuilder setGracefulRestart(GracefulRestart value)
-
setIpv4LabelledUnicast
public AfiSafiBuilder setIpv4LabelledUnicast(Ipv4LabelledUnicast value)
-
setIpv4Unicast
public AfiSafiBuilder setIpv4Unicast(Ipv4Unicast value)
-
setIpv6LabelledUnicast
public AfiSafiBuilder setIpv6LabelledUnicast(Ipv6LabelledUnicast value)
-
setIpv6Unicast
public AfiSafiBuilder setIpv6Unicast(Ipv6Unicast value)
-
setL2vpnEvpn
public AfiSafiBuilder setL2vpnEvpn(L2vpnEvpn value)
-
setL2vpnVpls
public AfiSafiBuilder setL2vpnVpls(L2vpnVpls value)
-
setL3vpnIpv4Multicast
public AfiSafiBuilder setL3vpnIpv4Multicast(L3vpnIpv4Multicast value)
-
setL3vpnIpv4Unicast
public AfiSafiBuilder setL3vpnIpv4Unicast(L3vpnIpv4Unicast value)
-
setL3vpnIpv6Multicast
public AfiSafiBuilder setL3vpnIpv6Multicast(L3vpnIpv6Multicast value)
-
setL3vpnIpv6Unicast
public AfiSafiBuilder setL3vpnIpv6Unicast(L3vpnIpv6Unicast value)
-
setState
public AfiSafiBuilder setState(State value)
-
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
public AfiSafi build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<AfiSafi>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<AfiSafi,IllegalArgumentException>
-
-