Class LinkDescriptorsBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptorsBuilder
-
@Generated("mdsal-binding-generator") public class LinkDescriptorsBuilder extends Object
Class that buildsLinkDescriptors
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:
LinkDescriptors createLinkDescriptors(int fooXyzzy, int barBaz) { return new LinkDescriptorsBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of LinkDescriptors, 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:
LinkDescriptors
- 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
-
-
Constructor Summary
Constructors Constructor Description LinkDescriptorsBuilder()
Construct an empty builder.LinkDescriptorsBuilder(LinkIdentifier arg)
Construct a new builder initialized from specifiedLinkIdentifier
.LinkDescriptorsBuilder(LinkLrIdentifiers arg)
Construct a new builder initialized from specifiedLinkLrIdentifiers
.LinkDescriptorsBuilder(LinkDescriptors base)
Construct a builder initialized with state from specifiedLinkDescriptors
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkDescriptorsBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<LinkDescriptors> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkDescriptors>>
E$$augmentation(Class<E$$> augmentationType)
Return the specified augmentation, if it is present in this builder.@NonNull LinkDescriptors
build()
A newLinkDescriptors
instance.void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.Ipv4InterfaceIdentifier
getIpv4InterfaceAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv4InterfaceAddress()
.Ipv4InterfaceIdentifier
getIpv4NeighborAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv4NeighborAddress()
.Ipv6InterfaceIdentifier
getIpv6InterfaceAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv6InterfaceAddress()
.Ipv6InterfaceIdentifier
getIpv6NeighborAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv6NeighborAddress()
.org.opendaylight.yangtools.yang.common.Uint32
getLinkLocalIdentifier()
Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkLocalIdentifier()
.org.opendaylight.yangtools.yang.common.Uint32
getLinkRemoteIdentifier()
Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
.TopologyIdentifier
getMultiTopologyId()
Return current value associated with the property corresponding toLinkIdentifier.getMultiTopologyId()
.LinkDescriptorsBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkDescriptors>> augmentationType)
Remove an augmentation from this builder's product.LinkDescriptorsBuilder
setIpv4InterfaceAddress(Ipv4InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv4InterfaceAddress()
to the specified value.LinkDescriptorsBuilder
setIpv4NeighborAddress(Ipv4InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv4NeighborAddress()
to the specified value.LinkDescriptorsBuilder
setIpv6InterfaceAddress(Ipv6InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv6InterfaceAddress()
to the specified value.LinkDescriptorsBuilder
setIpv6NeighborAddress(Ipv6InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv6NeighborAddress()
to the specified value.LinkDescriptorsBuilder
setLinkLocalIdentifier(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toLinkLrIdentifiers.getLinkLocalIdentifier()
to the specified value.LinkDescriptorsBuilder
setLinkRemoteIdentifier(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
to the specified value.LinkDescriptorsBuilder
setMultiTopologyId(TopologyIdentifier value)
Set the property corresponding toLinkIdentifier.getMultiTopologyId()
to the specified value.
-
-
-
Constructor Detail
-
LinkDescriptorsBuilder
public LinkDescriptorsBuilder()
Construct an empty builder.
-
LinkDescriptorsBuilder
public LinkDescriptorsBuilder(LinkIdentifier arg)
Construct a new builder initialized from specifiedLinkIdentifier
.- Parameters:
arg
- LinkIdentifier from which the builder should be initialized
-
LinkDescriptorsBuilder
public LinkDescriptorsBuilder(LinkLrIdentifiers arg)
Construct a new builder initialized from specifiedLinkLrIdentifiers
.- Parameters:
arg
- LinkLrIdentifiers from which the builder should be initialized
-
LinkDescriptorsBuilder
public LinkDescriptorsBuilder(LinkDescriptors base)
Construct a builder initialized with state from specifiedLinkDescriptors
.- Parameters:
base
- LinkDescriptors from which the builder should be initialized
-
-
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:- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
getIpv4InterfaceAddress
public Ipv4InterfaceIdentifier getIpv4InterfaceAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv4InterfaceAddress()
.- Returns:
- current value
-
getIpv4NeighborAddress
public Ipv4InterfaceIdentifier getIpv4NeighborAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv4NeighborAddress()
.- Returns:
- current value
-
getIpv6InterfaceAddress
public Ipv6InterfaceIdentifier getIpv6InterfaceAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv6InterfaceAddress()
.- Returns:
- current value
-
getIpv6NeighborAddress
public Ipv6InterfaceIdentifier getIpv6NeighborAddress()
Return current value associated with the property corresponding toLinkIdentifier.getIpv6NeighborAddress()
.- 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
-
getLinkRemoteIdentifier
public org.opendaylight.yangtools.yang.common.Uint32 getLinkRemoteIdentifier()
Return current value associated with the property corresponding toLinkLrIdentifiers.getLinkRemoteIdentifier()
.- Returns:
- current value
-
getMultiTopologyId
public TopologyIdentifier getMultiTopologyId()
Return current value associated with the property corresponding toLinkIdentifier.getMultiTopologyId()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkDescriptors>> 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
-
setIpv4InterfaceAddress
public LinkDescriptorsBuilder setIpv4InterfaceAddress(Ipv4InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv4InterfaceAddress()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv4NeighborAddress
public LinkDescriptorsBuilder setIpv4NeighborAddress(Ipv4InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv4NeighborAddress()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv6InterfaceAddress
public LinkDescriptorsBuilder setIpv6InterfaceAddress(Ipv6InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv6InterfaceAddress()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpv6NeighborAddress
public LinkDescriptorsBuilder setIpv6NeighborAddress(Ipv6InterfaceIdentifier value)
Set the property corresponding toLinkIdentifier.getIpv6NeighborAddress()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLinkLocalIdentifier
public LinkDescriptorsBuilder 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
-
setLinkRemoteIdentifier
public LinkDescriptorsBuilder 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
-
setMultiTopologyId
public LinkDescriptorsBuilder setMultiTopologyId(TopologyIdentifier value)
Set the property corresponding toLinkIdentifier.getMultiTopologyId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public LinkDescriptorsBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<LinkDescriptors> 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 LinkDescriptorsBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<LinkDescriptors>> 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 @NonNull LinkDescriptors build()
A newLinkDescriptors
instance.- Returns:
- A new
LinkDescriptors
instance.
-
-