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
Class that builds
LinkAttributes
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:
-
Constructor Summary
ConstructorDescriptionConstruct an empty builder.Construct a builder initialized with state from specifiedLinkAttributes
.Construct a new builder initialized from specifiedLinkstateAttribute
. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation
(org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes>>
E$$augmentation
(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.@NonNull LinkAttributes
build()
A newLinkAttributes
instance.static @NonNull LinkAttributes
empty()
Get empty instance of LinkAttributes.void
fieldsFrom
(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.Return current value associated with the property corresponding toLinkstateAttribute.getAdminGroup()
.Return current value associated with the property corresponding toLinkstateAttribute.getAvailableBandwidth()
.Return current value associated with the property corresponding toLinkstateAttribute.getDelayVariation()
.Return current value associated with the property corresponding toLinkstateAttribute.getLinkDelay()
.Return current value associated with the property corresponding toLinkstateAttribute.getLinkLoss()
.Return current value associated with the property corresponding toLinkstateAttribute.getLinkMinMaxDelay()
.Return current value associated with the property corresponding toLinkstateAttribute.getLinkName()
.Return current value associated with the property corresponding toLinkstateAttribute.getLinkProtection()
.Return current value associated with the property corresponding toLinkstateAttribute.getLocalIpv4RouterId()
.Return current value associated with the property corresponding toLinkstateAttribute.getLocalIpv6RouterId()
.Return current value associated with the property corresponding toLinkstateAttribute.getMaxLinkBandwidth()
.Return current value associated with the property corresponding toLinkstateAttribute.getMaxReservableBandwidth()
.Return current value associated with the property corresponding toLinkstateAttribute.getMetric()
.Return current value associated with the property corresponding toLinkstateAttribute.getMplsProtocol()
.Return current value associated with the property corresponding toLinkstateAttribute.getPeerAdjSid()
.Return current value associated with the property corresponding toLinkstateAttribute.getPeerNodeSid()
.Return current value associated with the property corresponding toLinkstateAttribute.getPeerSetSids()
.Return current value associated with the property corresponding toLinkstateAttribute.getRemoteIpv4RouterId()
.Return current value associated with the property corresponding toLinkstateAttribute.getRemoteIpv6RouterId()
.Return current value associated with the property corresponding toLinkstateAttribute.getResidualBandwidth()
.Return current value associated with the property corresponding toLinkstateAttribute.getSharedRiskLinkGroups()
.Return current value associated with the property corresponding toLinkstateAttribute.getSrAdjIds()
.Return current value associated with the property corresponding toLinkstateAttribute.getSrLanAdjIds()
.Return current value associated with the property corresponding toLinkstateAttribute.getTeMetric()
.Return current value associated with the property corresponding toLinkstateAttribute.getUnreservedBandwidth()
.Return current value associated with the property corresponding toLinkstateAttribute.getUtilizedBandwidth()
.removeAugmentation
(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes>> augmentationType) Remove an augmentation from this builder's product.setAdminGroup
(AdministrativeGroup value) Set the property corresponding toLinkstateAttribute.getAdminGroup()
to the specified value.setAvailableBandwidth
(Bandwidth value) Set the property corresponding toLinkstateAttribute.getAvailableBandwidth()
to the specified value.setDelayVariation
(Delay value) Set the property corresponding toLinkstateAttribute.getDelayVariation()
to the specified value.setLinkDelay
(Delay value) Set the property corresponding toLinkstateAttribute.getLinkDelay()
to the specified value.setLinkLoss
(Loss value) Set the property corresponding toLinkstateAttribute.getLinkLoss()
to the specified value.Set the property corresponding toLinkstateAttribute.getLinkMinMaxDelay()
to the specified value.setLinkName
(String value) Set the property corresponding toLinkstateAttribute.getLinkName()
to the specified value.Set the property corresponding toLinkstateAttribute.getLinkProtection()
to the specified value.Set the property corresponding toLinkstateAttribute.getLocalIpv4RouterId()
to the specified value.Set the property corresponding toLinkstateAttribute.getLocalIpv6RouterId()
to the specified value.setMaxLinkBandwidth
(Bandwidth value) Set the property corresponding toLinkstateAttribute.getMaxLinkBandwidth()
to the specified value.Set the property corresponding toLinkstateAttribute.getMaxReservableBandwidth()
to the specified value.Set the property corresponding toLinkstateAttribute.getMetric()
to the specified value.setMplsProtocol
(MplsProtocolMask value) Set the property corresponding toLinkstateAttribute.getMplsProtocol()
to the specified value.setPeerAdjSid
(PeerAdjSid value) Set the property corresponding toLinkstateAttribute.getPeerAdjSid()
to the specified value.setPeerNodeSid
(PeerNodeSid value) Set the property corresponding toLinkstateAttribute.getPeerNodeSid()
to the specified value.setPeerSetSids
(List<PeerSetSids> values) Set the property corresponding toLinkstateAttribute.getPeerSetSids()
to the specified value.Set the property corresponding toLinkstateAttribute.getRemoteIpv4RouterId()
to the specified value.Set the property corresponding toLinkstateAttribute.getRemoteIpv6RouterId()
to the specified value.setResidualBandwidth
(Bandwidth value) Set the property corresponding toLinkstateAttribute.getResidualBandwidth()
to the specified value.setSharedRiskLinkGroups
(Set<SrlgId> values) Set the property corresponding toLinkstateAttribute.getSharedRiskLinkGroups()
to the specified value.setSrAdjIds
(List<SrAdjIds> values) Set the property corresponding toLinkstateAttribute.getSrAdjIds()
to the specified value.setSrLanAdjIds
(List<SrLanAdjIds> values) Set the property corresponding toLinkstateAttribute.getSrLanAdjIds()
to the specified value.setTeMetric
(TeMetric value) Set the property corresponding toLinkstateAttribute.getTeMetric()
to the specified value.Set the property corresponding toLinkstateAttribute.getUnreservedBandwidth()
to the specified value.setUtilizedBandwidth
(Bandwidth value) Set the property corresponding toLinkstateAttribute.getUtilizedBandwidth()
to the specified value.
-
Constructor Details
-
LinkAttributesBuilder
public LinkAttributesBuilder()Construct an empty builder. -
LinkAttributesBuilder
Construct a new builder initialized from specifiedLinkstateAttribute
.- Parameters:
arg
- LinkstateAttribute from which the builder should be initialized
-
LinkAttributesBuilder
Construct a builder initialized with state from specifiedLinkAttributes
.- Parameters:
base
- LinkAttributes from which the builder should be initialized
-
-
Method Details
-
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:- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
empty
Get empty instance of LinkAttributes.- Returns:
- An empty
LinkAttributes
-
getAdminGroup
Return current value associated with the property corresponding toLinkstateAttribute.getAdminGroup()
.- Returns:
- current value
-
getAvailableBandwidth
Return current value associated with the property corresponding toLinkstateAttribute.getAvailableBandwidth()
.- Returns:
- current value
-
getDelayVariation
Return current value associated with the property corresponding toLinkstateAttribute.getDelayVariation()
.- Returns:
- current value
-
getLinkDelay
Return current value associated with the property corresponding toLinkstateAttribute.getLinkDelay()
.- Returns:
- current value
-
getLinkLoss
Return current value associated with the property corresponding toLinkstateAttribute.getLinkLoss()
.- Returns:
- current value
-
getLinkMinMaxDelay
Return current value associated with the property corresponding toLinkstateAttribute.getLinkMinMaxDelay()
.- Returns:
- current value
-
getLinkName
Return current value associated with the property corresponding toLinkstateAttribute.getLinkName()
.- Returns:
- current value
-
getLinkProtection
Return current value associated with the property corresponding toLinkstateAttribute.getLinkProtection()
.- Returns:
- current value
-
getLocalIpv4RouterId
Return current value associated with the property corresponding toLinkstateAttribute.getLocalIpv4RouterId()
.- Returns:
- current value
-
getLocalIpv6RouterId
Return current value associated with the property corresponding toLinkstateAttribute.getLocalIpv6RouterId()
.- Returns:
- current value
-
getMaxLinkBandwidth
Return current value associated with the property corresponding toLinkstateAttribute.getMaxLinkBandwidth()
.- Returns:
- current value
-
getMaxReservableBandwidth
Return current value associated with the property corresponding toLinkstateAttribute.getMaxReservableBandwidth()
.- Returns:
- current value
-
getMetric
Return current value associated with the property corresponding toLinkstateAttribute.getMetric()
.- Returns:
- current value
-
getMplsProtocol
Return current value associated with the property corresponding toLinkstateAttribute.getMplsProtocol()
.- Returns:
- current value
-
getPeerAdjSid
Return current value associated with the property corresponding toLinkstateAttribute.getPeerAdjSid()
.- Returns:
- current value
-
getPeerNodeSid
Return current value associated with the property corresponding toLinkstateAttribute.getPeerNodeSid()
.- Returns:
- current value
-
getPeerSetSids
Return current value associated with the property corresponding toLinkstateAttribute.getPeerSetSids()
.- Returns:
- current value
-
getRemoteIpv4RouterId
Return current value associated with the property corresponding toLinkstateAttribute.getRemoteIpv4RouterId()
.- Returns:
- current value
-
getRemoteIpv6RouterId
Return current value associated with the property corresponding toLinkstateAttribute.getRemoteIpv6RouterId()
.- Returns:
- current value
-
getResidualBandwidth
Return current value associated with the property corresponding toLinkstateAttribute.getResidualBandwidth()
.- Returns:
- current value
-
getSrAdjIds
Return current value associated with the property corresponding toLinkstateAttribute.getSrAdjIds()
.- Returns:
- current value
-
getSrLanAdjIds
Return current value associated with the property corresponding toLinkstateAttribute.getSrLanAdjIds()
.- Returns:
- current value
-
getTeMetric
Return current value associated with the property corresponding toLinkstateAttribute.getTeMetric()
.- Returns:
- current value
-
getUnreservedBandwidth
Return current value associated with the property corresponding toLinkstateAttribute.getUnreservedBandwidth()
.- Returns:
- current value
-
getUtilizedBandwidth
Return current value associated with the property corresponding toLinkstateAttribute.getUtilizedBandwidth()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkAttributes>> E$$ augmentation(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.- Type Parameters:
E$$
- augmentation type- Parameters:
augmentationType
- augmentation type class- Returns:
- Augmentation object from this builder, or
null
if not present - Throws:
NullPointerException
- ifaugmentType
isnull
-
setAdminGroup
Set the property corresponding toLinkstateAttribute.getAdminGroup()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setAvailableBandwidth
Set the property corresponding toLinkstateAttribute.getAvailableBandwidth()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDelayVariation
Set the property corresponding toLinkstateAttribute.getDelayVariation()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLinkDelay
Set the property corresponding toLinkstateAttribute.getLinkDelay()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLinkLoss
Set the property corresponding toLinkstateAttribute.getLinkLoss()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLinkMinMaxDelay
Set the property corresponding toLinkstateAttribute.getLinkMinMaxDelay()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLinkName
Set the property corresponding toLinkstateAttribute.getLinkName()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLinkProtection
Set the property corresponding toLinkstateAttribute.getLinkProtection()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLocalIpv4RouterId
Set the property corresponding toLinkstateAttribute.getLocalIpv4RouterId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLocalIpv6RouterId
Set the property corresponding toLinkstateAttribute.getLocalIpv6RouterId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMaxLinkBandwidth
Set the property corresponding toLinkstateAttribute.getMaxLinkBandwidth()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMaxReservableBandwidth
Set the property corresponding toLinkstateAttribute.getMaxReservableBandwidth()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMetric
Set the property corresponding toLinkstateAttribute.getMetric()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMplsProtocol
Set the property corresponding toLinkstateAttribute.getMplsProtocol()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPeerAdjSid
Set the property corresponding toLinkstateAttribute.getPeerAdjSid()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPeerNodeSid
Set the property corresponding toLinkstateAttribute.getPeerNodeSid()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPeerSetSids
Set the property corresponding toLinkstateAttribute.getPeerSetSids()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setRemoteIpv4RouterId
Set the property corresponding toLinkstateAttribute.getRemoteIpv4RouterId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRemoteIpv6RouterId
Set the property corresponding toLinkstateAttribute.getRemoteIpv6RouterId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setResidualBandwidth
Set the property corresponding toLinkstateAttribute.getResidualBandwidth()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSrAdjIds
Set the property corresponding toLinkstateAttribute.getSrAdjIds()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setSrLanAdjIds
Set the property corresponding toLinkstateAttribute.getSrLanAdjIds()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setTeMetric
Set the property corresponding toLinkstateAttribute.getTeMetric()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setUnreservedBandwidth
public LinkAttributesBuilder setUnreservedBandwidth(Map<UnreservedBandwidthKey, UnreservedBandwidth> values) Set the property corresponding toLinkstateAttribute.getUnreservedBandwidth()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setUtilizedBandwidth
Set the property corresponding toLinkstateAttribute.getUtilizedBandwidth()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
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
A newLinkAttributes
instance.- Returns:
- A new
LinkAttributes
instance.
-