Class ExtCommunityMemberBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.ext.community.sets.ext.community.set.ExtCommunityMemberBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<ExtCommunityMember>
,org.opendaylight.yangtools.concepts.CheckedBuilder<ExtCommunityMember,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class ExtCommunityMemberBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<ExtCommunityMember>
Class that buildsExtCommunityMemberBuilder
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:
ExtCommunityMemberBuilder createTarget(int fooXyzzy, int barBaz) { return new ExtCommunityMemberBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of ExtCommunityMemberBuilder, 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:
ExtCommunityMemberBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description ExtCommunityMemberBuilder()
ExtCommunityMemberBuilder(ExtCommunityMember base)
ExtCommunityMemberBuilder(ExtendedCommunity arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtCommunityMemberBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember>>
E$$augmentation(Class<E$$> augmentationType)
ExtCommunityMember
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.ExtendedCommunity
getExtendedCommunity()
Boolean
isTransitive()
ExtCommunityMemberBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember>> augmentationType)
ExtCommunityMemberBuilder
setExtendedCommunity(ExtendedCommunity value)
ExtCommunityMemberBuilder
setTransitive(Boolean value)
-
-
-
Constructor Detail
-
ExtCommunityMemberBuilder
public ExtCommunityMemberBuilder()
-
ExtCommunityMemberBuilder
public ExtCommunityMemberBuilder(ExtendedCommunity arg)
-
ExtCommunityMemberBuilder
public ExtCommunityMemberBuilder(ExtCommunityMember 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.opendaylight.params.xml.ns.yang.bgp.types.rev200120.ExtendedCommunity
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getExtendedCommunity
public ExtendedCommunity getExtendedCommunity()
-
isTransitive
public Boolean isTransitive()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember>> E$$ augmentation(Class<E$$> augmentationType)
-
setExtendedCommunity
public ExtCommunityMemberBuilder setExtendedCommunity(ExtendedCommunity value)
-
setTransitive
public ExtCommunityMemberBuilder setTransitive(Boolean value)
-
addAugmentation
public ExtCommunityMemberBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember> augmentationValue)
-
removeAugmentation
public ExtCommunityMemberBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ExtCommunityMember>> augmentationType)
-
build
public ExtCommunityMember build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<ExtCommunityMember>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<ExtCommunityMember,IllegalArgumentException>
-
-