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
ConstructorsConstructorDescriptionConstruct an empty builder.Construct a new builder initialized from specifiedLinkLrIdentifiers
.Construct a builder initialized with state from specifiedLinkAttributes
.Construct a new builder initialized from specifiedLinkstateAttribute
. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation
(org.opendaylight.yangtools.binding.Augmentation<LinkAttributes> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.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.binding.Grouping arg) Set fields from given grouping argument.Return current value associated with the property corresponding toLinkstateAttribute.getAslaMetric()
.Return current value associated with the property corresponding toLinkstateAttribute.getEgressPeerEngineering()
.Return current value associated with the property corresponding toLinkstateAttribute.getExtendedAdminGroup()
.Return current value associated with the property corresponding toLinkstateAttribute.getL2BundleMember()
.org.opendaylight.yangtools.yang.common.Uint32
Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkLocalIdentifier()
.Return current value associated with the property corresponding toLinkstateAttribute.getLinkName()
.org.opendaylight.yangtools.yang.common.Uint32
Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
.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.getMetric()
.Return current value associated with the property corresponding toLinkstateAttribute.getMplsProtocol()
.byte[]
Return current value associated with the property corresponding toLinkstateAttribute.getOpaqueLink()
.Return current value associated with the property corresponding toLinkstateAttribute.getPerformanceMetric()
.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.getSharedRiskLinkGroups()
.Return current value associated with the property corresponding toLinkstateAttribute.getSrAttribute()
.getSrv6()
Return current value associated with the property corresponding toLinkstateAttribute.getSrv6()
.Return current value associated with the property corresponding toLinkstateAttribute.getStandardMetric()
.removeAugmentation
(Class<? extends org.opendaylight.yangtools.binding.Augmentation<LinkAttributes>> augmentationType) Remove an augmentation from this builder's product.setAslaMetric
(AslaMetric value) Set the property corresponding toLinkstateAttribute.getAslaMetric()
to the specified value.Set the property corresponding toLinkstateAttribute.getEgressPeerEngineering()
to the specified value.setExtendedAdminGroup
(Set<ExtendedAdminGroup> values) Set the property corresponding toLinkstateAttribute.getExtendedAdminGroup()
to the specified value.setL2BundleMember
(List<L2BundleMember> values) Set the property corresponding toLinkstateAttribute.getL2BundleMember()
to the specified value.setLinkLocalIdentifier
(org.opendaylight.yangtools.yang.common.Uint32 value) Set the property corresponding toLinkLrIdentifiers.getLinkLocalIdentifier()
to the specified value.setLinkName
(String value) Set the property corresponding toLinkstateAttribute.getLinkName()
to the specified value.setLinkRemoteIdentifier
(org.opendaylight.yangtools.yang.common.Uint32 value) Set the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
to the specified value.Set the property corresponding toLinkstateAttribute.getLocalIpv4RouterId()
to the specified value.Set the property corresponding toLinkstateAttribute.getLocalIpv6RouterId()
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.setOpaqueLink
(byte[] value) Set the property corresponding toLinkstateAttribute.getOpaqueLink()
to the specified value.Set the property corresponding toLinkstateAttribute.getPerformanceMetric()
to the specified value.Set the property corresponding toLinkstateAttribute.getRemoteIpv4RouterId()
to the specified value.Set the property corresponding toLinkstateAttribute.getRemoteIpv6RouterId()
to the specified value.setSharedRiskLinkGroups
(Set<SrlgId> values) Set the property corresponding toLinkstateAttribute.getSharedRiskLinkGroups()
to the specified value.setSrAttribute
(SrAttribute value) Set the property corresponding toLinkstateAttribute.getSrAttribute()
to the specified value.Set the property corresponding toLinkstateAttribute.getSrv6()
to the specified value.setStandardMetric
(StandardMetric value) Set the property corresponding toLinkstateAttribute.getStandardMetric()
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 new builder initialized from specifiedLinkLrIdentifiers
.- Parameters:
arg
- LinkLrIdentifiers 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.binding.Grouping 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
-
getAslaMetric
Return current value associated with the property corresponding toLinkstateAttribute.getAslaMetric()
.- Returns:
- current value
-
getEgressPeerEngineering
Return current value associated with the property corresponding toLinkstateAttribute.getEgressPeerEngineering()
.- Returns:
- current value
-
getExtendedAdminGroup
Return current value associated with the property corresponding toLinkstateAttribute.getExtendedAdminGroup()
.- Returns:
- current value
-
getL2BundleMember
Return current value associated with the property corresponding toLinkstateAttribute.getL2BundleMember()
.- Returns:
- current value
-
getLinkLocalIdentifier
public org.opendaylight.yangtools.yang.common.Uint32 getLinkLocalIdentifier()Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkLocalIdentifier()
.- Returns:
- current value
-
getLinkName
Return current value associated with the property corresponding toLinkstateAttribute.getLinkName()
.- Returns:
- current value
-
getLinkRemoteIdentifier
public org.opendaylight.yangtools.yang.common.Uint32 getLinkRemoteIdentifier()Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
.- 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
-
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
-
getOpaqueLink
public byte[] getOpaqueLink()Return current value associated with the property corresponding toLinkstateAttribute.getOpaqueLink()
.- Returns:
- current value
-
getPerformanceMetric
Return current value associated with the property corresponding toLinkstateAttribute.getPerformanceMetric()
.- 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
-
getSrAttribute
Return current value associated with the property corresponding toLinkstateAttribute.getSrAttribute()
.- Returns:
- current value
-
getSrv6
Return current value associated with the property corresponding toLinkstateAttribute.getSrv6()
.- Returns:
- current value
-
getStandardMetric
Return current value associated with the property corresponding toLinkstateAttribute.getStandardMetric()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.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
-
setAslaMetric
Set the property corresponding toLinkstateAttribute.getAslaMetric()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setEgressPeerEngineering
Set the property corresponding toLinkstateAttribute.getEgressPeerEngineering()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setExtendedAdminGroup
Set the property corresponding toLinkstateAttribute.getExtendedAdminGroup()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setL2BundleMember
Set the property corresponding toLinkstateAttribute.getL2BundleMember()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setLinkLocalIdentifier
public LinkAttributesBuilder setLinkLocalIdentifier(org.opendaylight.yangtools.yang.common.Uint32 value) Set the property corresponding toLinkLrIdentifiers.getLinkLocalIdentifier()
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
-
setLinkRemoteIdentifier
public LinkAttributesBuilder setLinkRemoteIdentifier(org.opendaylight.yangtools.yang.common.Uint32 value) Set the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
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
-
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
-
setOpaqueLink
Set the property corresponding toLinkstateAttribute.getOpaqueLink()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPerformanceMetric
Set the property corresponding toLinkstateAttribute.getPerformanceMetric()
to the specified value.- Parameters:
value
- 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
-
setSrAttribute
Set the property corresponding toLinkstateAttribute.getSrAttribute()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSrv6
Set the property corresponding toLinkstateAttribute.getSrv6()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setStandardMetric
Set the property corresponding toLinkstateAttribute.getStandardMetric()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public LinkAttributesBuilder addAugmentation(org.opendaylight.yangtools.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.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.
-