Class P2pBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq.message.pcreq.message.requests.segment.computation.P2pBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<P2p>
,org.opendaylight.yangtools.concepts.CheckedBuilder<P2p,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
@Generated("mdsal-binding-generator") public class P2pBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<P2p>
Class that buildsP2p
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:
P2p createP2p(int fooXyzzy, int barBaz) { return new P2pBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of P2p, 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:
P2p
,Builder
-
-
Constructor Summary
Constructors Constructor Description P2pBuilder()
P2pBuilder(BandwidthObject arg)
P2pBuilder(ClasstypeObject arg)
P2pBuilder(EndpointsObject arg)
P2pBuilder(ExcludeRouteObject arg)
P2pBuilder(IncludeRouteObject arg)
P2pBuilder(LoadBalancingObject arg)
P2pBuilder(LspaObject arg)
P2pBuilder(LspAttributes arg)
P2pBuilder(OfObject arg)
P2pBuilder(P2p base)
P2pBuilder(ReoptimizationBandwidthObject arg)
P2pBuilder(ReportedRouteObject arg)
P2pBuilder(VendorInformationObjects arg)
-
Method Summary
-
-
-
Constructor Detail
-
P2pBuilder
public P2pBuilder()
-
P2pBuilder
public P2pBuilder(EndpointsObject arg)
-
P2pBuilder
public P2pBuilder(VendorInformationObjects arg)
-
P2pBuilder
public P2pBuilder(LoadBalancingObject arg)
-
P2pBuilder
public P2pBuilder(LspAttributes arg)
-
P2pBuilder
public P2pBuilder(LspaObject arg)
-
P2pBuilder
public P2pBuilder(BandwidthObject arg)
-
P2pBuilder
public P2pBuilder(ReoptimizationBandwidthObject arg)
-
P2pBuilder
public P2pBuilder(IncludeRouteObject arg)
-
P2pBuilder
public P2pBuilder(ReportedRouteObject arg)
-
P2pBuilder
public P2pBuilder(ExcludeRouteObject arg)
-
P2pBuilder
public P2pBuilder(OfObject arg)
-
P2pBuilder
public P2pBuilder(ClasstypeObject arg)
-
P2pBuilder
public P2pBuilder(P2p 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:- ClasstypeObject
- ReoptimizationBandwidthObject
- BandwidthObject
- OfObject
- ReportedRouteObject
- EndpointsObject
- LoadBalancingObject
- LspAttributes
- IncludeRouteObject
- ExcludeRouteObject
- VendorInformationObjects
- LspaObject
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
getBandwidth
public Bandwidth getBandwidth()
-
getClassType
public ClassType getClassType()
-
getEndpointsObj
public EndpointsObj getEndpointsObj()
-
getIro
public Iro getIro()
-
getLoadBalancing
public LoadBalancing getLoadBalancing()
-
getLspa
public Lspa getLspa()
-
getOf
public Of getOf()
-
getReoptimizationBandwidth
public ReoptimizationBandwidth getReoptimizationBandwidth()
-
getReportedRoute
public ReportedRoute getReportedRoute()
-
getRro
public Rro getRro()
-
getVendorInformationObject
public List<VendorInformationObject> getVendorInformationObject()
-
getXro
public Xro getXro()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<P2p>> E$$ augmentation(Class<E$$> augmentationType)
-
setBandwidth
public P2pBuilder setBandwidth(Bandwidth value)
-
setClassType
public P2pBuilder setClassType(ClassType value)
-
setEndpointsObj
public P2pBuilder setEndpointsObj(EndpointsObj value)
-
setIro
public P2pBuilder setIro(Iro value)
-
setLoadBalancing
public P2pBuilder setLoadBalancing(LoadBalancing value)
-
setLspa
public P2pBuilder setLspa(Lspa value)
-
setMetrics
public P2pBuilder setMetrics(List<Metrics> values)
-
setOf
public P2pBuilder setOf(Of value)
-
setReoptimizationBandwidth
public P2pBuilder setReoptimizationBandwidth(ReoptimizationBandwidth value)
-
setReportedRoute
public P2pBuilder setReportedRoute(ReportedRoute value)
-
setRro
public P2pBuilder setRro(Rro value)
-
setVendorInformationObject
public P2pBuilder setVendorInformationObject(List<VendorInformationObject> values)
-
setXro
public P2pBuilder setXro(Xro value)
-
addAugmentation
public P2pBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<P2p> 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 P2pBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<P2p>> 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 P2p build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<P2p>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<P2p,IllegalArgumentException>
-
-