Class LinkAttributesBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.path.attribute.link.state.attribute.link.attributes._case.LinkAttributesBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<LinkAttributes>
,org.opendaylight.yangtools.concepts.CheckedBuilder<LinkAttributes,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
@Generated("mdsal-binding-generator") public class LinkAttributesBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<LinkAttributes>
Class that buildsLinkAttributes
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:
LinkAttributes createLinkAttributes(int fooXyzzy, int barBaz) { return new LinkAttributesBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of LinkAttributes, 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:
LinkAttributes
,Builder
-
-
Constructor Summary
Constructors Constructor Description LinkAttributesBuilder()
LinkAttributesBuilder(LinkAttributes base)
LinkAttributesBuilder(LinkstateAttribute arg)
-
Method Summary
-
-
-
Constructor Detail
-
LinkAttributesBuilder
public LinkAttributesBuilder()
-
LinkAttributesBuilder
public LinkAttributesBuilder(LinkstateAttribute arg)
-
LinkAttributesBuilder
public LinkAttributesBuilder(LinkAttributes 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:- LinkstateAttribute
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
getAdminGroup
public AdministrativeGroup getAdminGroup()
-
getAvailableBandwidth
public Bandwidth getAvailableBandwidth()
-
getDelayVariation
public Delay getDelayVariation()
-
getLinkDelay
public Delay getLinkDelay()
-
getLinkLoss
public Loss getLinkLoss()
-
getLinkMinMaxDelay
public LinkMinMaxDelay getLinkMinMaxDelay()
-
getLinkName
public String getLinkName()
-
getLinkProtection
public LinkProtectionType getLinkProtection()
-
getLocalIpv4RouterId
public Ipv4RouterIdentifier getLocalIpv4RouterId()
-
getLocalIpv6RouterId
public Ipv6RouterIdentifier getLocalIpv6RouterId()
-
getMaxLinkBandwidth
public Bandwidth getMaxLinkBandwidth()
-
getMaxReservableBandwidth
public Bandwidth getMaxReservableBandwidth()
-
getMetric
public Metric getMetric()
-
getMplsProtocol
public MplsProtocolMask getMplsProtocol()
-
getPeerAdjSid
public PeerAdjSid getPeerAdjSid()
-
getPeerNodeSid
public PeerNodeSid getPeerNodeSid()
-
getPeerSetSids
public List<PeerSetSids> getPeerSetSids()
-
getRemoteIpv4RouterId
public Ipv4RouterIdentifier getRemoteIpv4RouterId()
-
getRemoteIpv6RouterId
public Ipv6RouterIdentifier getRemoteIpv6RouterId()
-
getResidualBandwidth
public Bandwidth getResidualBandwidth()
-
getSrLanAdjIds
public List<SrLanAdjIds> getSrLanAdjIds()
-
getTeMetric
public TeMetric getTeMetric()
-
getUnreservedBandwidth
public Map<UnreservedBandwidthKey,UnreservedBandwidth> getUnreservedBandwidth()
-
getUtilizedBandwidth
public Bandwidth getUtilizedBandwidth()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes>> E$$ augmentation(Class<E$$> augmentationType)
-
setAdminGroup
public LinkAttributesBuilder setAdminGroup(AdministrativeGroup value)
-
setAvailableBandwidth
public LinkAttributesBuilder setAvailableBandwidth(Bandwidth value)
-
setDelayVariation
public LinkAttributesBuilder setDelayVariation(Delay value)
-
setLinkDelay
public LinkAttributesBuilder setLinkDelay(Delay value)
-
setLinkLoss
public LinkAttributesBuilder setLinkLoss(Loss value)
-
setLinkMinMaxDelay
public LinkAttributesBuilder setLinkMinMaxDelay(LinkMinMaxDelay value)
-
setLinkName
public LinkAttributesBuilder setLinkName(String value)
-
setLinkProtection
public LinkAttributesBuilder setLinkProtection(LinkProtectionType value)
-
setLocalIpv4RouterId
public LinkAttributesBuilder setLocalIpv4RouterId(Ipv4RouterIdentifier value)
-
setLocalIpv6RouterId
public LinkAttributesBuilder setLocalIpv6RouterId(Ipv6RouterIdentifier value)
-
setMaxLinkBandwidth
public LinkAttributesBuilder setMaxLinkBandwidth(Bandwidth value)
-
setMaxReservableBandwidth
public LinkAttributesBuilder setMaxReservableBandwidth(Bandwidth value)
-
setMetric
public LinkAttributesBuilder setMetric(Metric value)
-
setMplsProtocol
public LinkAttributesBuilder setMplsProtocol(MplsProtocolMask value)
-
setPeerAdjSid
public LinkAttributesBuilder setPeerAdjSid(PeerAdjSid value)
-
setPeerNodeSid
public LinkAttributesBuilder setPeerNodeSid(PeerNodeSid value)
-
setPeerSetSids
public LinkAttributesBuilder setPeerSetSids(List<PeerSetSids> values)
-
setRemoteIpv4RouterId
public LinkAttributesBuilder setRemoteIpv4RouterId(Ipv4RouterIdentifier value)
-
setRemoteIpv6RouterId
public LinkAttributesBuilder setRemoteIpv6RouterId(Ipv6RouterIdentifier value)
-
setResidualBandwidth
public LinkAttributesBuilder setResidualBandwidth(Bandwidth value)
-
setSharedRiskLinkGroups
public LinkAttributesBuilder setSharedRiskLinkGroups(List<SrlgId> values)
-
setSrAdjIds
public LinkAttributesBuilder setSrAdjIds(List<SrAdjIds> values)
-
setSrLanAdjIds
public LinkAttributesBuilder setSrLanAdjIds(List<SrLanAdjIds> values)
-
setTeMetric
public LinkAttributesBuilder setTeMetric(TeMetric value)
-
setUnreservedBandwidth
public LinkAttributesBuilder setUnreservedBandwidth(Map<UnreservedBandwidthKey,UnreservedBandwidth> values)
-
setUtilizedBandwidth
public LinkAttributesBuilder setUtilizedBandwidth(Bandwidth value)
-
addAugmentation
public LinkAttributesBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes> 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 LinkAttributesBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes>> 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 LinkAttributes build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<LinkAttributes>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<LinkAttributes,IllegalArgumentException>
-
-