Class RouteTargetConstrainRouteCaseBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.route.target.constrain.route.target.constrain.choice.RouteTargetConstrainRouteCaseBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<RouteTargetConstrainRouteCase>
,org.opendaylight.yangtools.concepts.CheckedBuilder<RouteTargetConstrainRouteCase,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class RouteTargetConstrainRouteCaseBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<RouteTargetConstrainRouteCase>
Class that buildsRouteTargetConstrainRouteCaseBuilder
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:
RouteTargetConstrainRouteCaseBuilder createTarget(int fooXyzzy, int barBaz) { return new RouteTargetConstrainRouteCaseBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of RouteTargetConstrainRouteCaseBuilder, 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:
RouteTargetConstrainRouteCaseBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description RouteTargetConstrainRouteCaseBuilder()
RouteTargetConstrainRouteCaseBuilder(RouteTargetConstrainRouteCase base)
RouteTargetConstrainRouteCaseBuilder(RouteTargetExtendedCommunityGrouping arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RouteTargetConstrainRouteCaseBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase>>
E$$augmentation(Class<E$$> augmentationType)
RouteTargetConstrainRouteCase
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.RouteTargetExtendedCommunity
getRouteTargetExtendedCommunity()
RouteTargetConstrainRouteCaseBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase>> augmentationType)
RouteTargetConstrainRouteCaseBuilder
setRouteTargetExtendedCommunity(RouteTargetExtendedCommunity value)
-
-
-
Constructor Detail
-
RouteTargetConstrainRouteCaseBuilder
public RouteTargetConstrainRouteCaseBuilder()
-
RouteTargetConstrainRouteCaseBuilder
public RouteTargetConstrainRouteCaseBuilder(RouteTargetExtendedCommunityGrouping arg)
-
RouteTargetConstrainRouteCaseBuilder
public RouteTargetConstrainRouteCaseBuilder(RouteTargetConstrainRouteCase 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.RouteTargetExtendedCommunityGrouping
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getRouteTargetExtendedCommunity
public RouteTargetExtendedCommunity getRouteTargetExtendedCommunity()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase>> E$$ augmentation(Class<E$$> augmentationType)
-
setRouteTargetExtendedCommunity
public RouteTargetConstrainRouteCaseBuilder setRouteTargetExtendedCommunity(RouteTargetExtendedCommunity value)
-
addAugmentation
public RouteTargetConstrainRouteCaseBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase> augmentationValue)
-
removeAugmentation
public RouteTargetConstrainRouteCaseBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<RouteTargetConstrainRouteCase>> augmentationType)
-
build
public RouteTargetConstrainRouteCase build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<RouteTargetConstrainRouteCase>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<RouteTargetConstrainRouteCase,IllegalArgumentException>
-
-