Class AttributesBuilder
java.lang.Object
org.opendaylight.yangtools.binding.lib.AugmentableBuilder<Attributes,AttributesBuilder>
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Mutable
@Generated("mdsal-binding-generator")
public class AttributesBuilder
extends org.opendaylight.yangtools.binding.lib.AugmentableBuilder<Attributes,AttributesBuilder>
Class that builds
Attributes 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:
Attributes createAttributes(int fooXyzzy, int barBaz) {
return new AttributesBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of Attributes, 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.AttributesBuilder(Attributes base) Construct a builder initialized with state from specifiedAttributes.AttributesBuilder(NextHop arg) Construct a new builder initialized from specifiedNextHop. -
Method Summary
Modifier and TypeMethodDescription@NonNull Attributesbuild()Returns A newAttributesinstance.static @NonNull Attributesempty()Returns an emptyAttributes.voidfieldsFrom(org.opendaylight.yangtools.binding.Grouping arg) Set fields from given grouping argument.Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releasegetAigp()Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseDeprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releasesetAggregator(Aggregator value) Set the property corresponding toAttributes.getAggregator()to the specified value.Set the property corresponding toAttributes.getAigp()to the specified value.Set the property corresponding toAttributes.getAsPath()to the specified value.Set the property corresponding toAttributes.getAtomicAggregate()to the specified value.setBgpPrefixSid(BgpPrefixSid value) Set the property corresponding toAttributes.getBgpPrefixSid()to the specified value.setClusterId(ClusterId value) Set the property corresponding toAttributes.getClusterId()to the specified value.setCNextHop(CNextHop value) Set the property corresponding toNextHop.getCNextHop()to the specified value.setCommunities(List<Communities> values) Set the property corresponding toAttributes.getCommunities()to the specified value.Set the property corresponding toAttributes.getExtendedCommunities()to the specified value.setLocalPref(LocalPref value) Set the property corresponding toAttributes.getLocalPref()to the specified value.setMultiExitDisc(MultiExitDisc value) Set the property corresponding toAttributes.getMultiExitDisc()to the specified value.Set the property corresponding toAttributes.getOrigin()to the specified value.setOriginatorId(OriginatorId value) Set the property corresponding toAttributes.getOriginatorId()to the specified value.Set the property corresponding toAttributes.getUnrecognizedAttributes()to the specified value.Methods inherited from class org.opendaylight.yangtools.binding.lib.AugmentableBuilder
addAugmentation, augmentation, augmentations, removeAugmentation
-
Constructor Details
-
AttributesBuilder
public AttributesBuilder()Construct an empty builder. -
AttributesBuilder
Construct a new builder initialized from specifiedNextHop.- Parameters:
arg- NextHop from which the builder should be initialized
-
AttributesBuilder
Construct a builder initialized with state from specifiedAttributes.- Parameters:
base- Attributes 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
Returns an emptyAttributes.- Returns:
- an empty
Attributes
-
getAggregator
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getAggregator().- Returns:
- current value
-
getAigp
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getAigp().- Returns:
- current value
-
getAsPath
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getAsPath().- Returns:
- current value
-
getAtomicAggregate
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getAtomicAggregate().- Returns:
- current value
-
getBgpPrefixSid
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getBgpPrefixSid().- Returns:
- current value
-
getCNextHop
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toNextHop.getCNextHop().- Returns:
- current value
-
getClusterId
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getClusterId().- Returns:
- current value
-
getCommunities
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getCommunities().- Returns:
- current value
-
getExtendedCommunities
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getExtendedCommunities().- Returns:
- current value
-
getLocalPref
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getLocalPref().- Returns:
- current value
-
getMultiExitDisc
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getMultiExitDisc().- Returns:
- current value
-
getOrigin
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getOrigin().- Returns:
- current value
-
getOriginatorId
Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getOriginatorId().- Returns:
- current value
-
getUnrecognizedAttributes
@Deprecated(forRemoval=true) public Map<UnrecognizedAttributesKey,UnrecognizedAttributes> getUnrecognizedAttributes()Deprecated, for removal: This API element is subject to removal in a future version.This method will not be generated in a future releaseReturn current value associated with the property corresponding toAttributes.getUnrecognizedAttributes().- Returns:
- current value
-
setAggregator
Set the property corresponding toAttributes.getAggregator()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setAigp
Set the property corresponding toAttributes.getAigp()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setAsPath
Set the property corresponding toAttributes.getAsPath()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setAtomicAggregate
Set the property corresponding toAttributes.getAtomicAggregate()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setBgpPrefixSid
Set the property corresponding toAttributes.getBgpPrefixSid()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setCNextHop
Set the property corresponding toNextHop.getCNextHop()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setClusterId
Set the property corresponding toAttributes.getClusterId()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setCommunities
Set the property corresponding toAttributes.getCommunities()to the specified value.- Parameters:
values- desired value- Returns:
- this builder
-
setExtendedCommunities
Set the property corresponding toAttributes.getExtendedCommunities()to the specified value.- Parameters:
values- desired value- Returns:
- this builder
-
setLocalPref
Set the property corresponding toAttributes.getLocalPref()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setMultiExitDisc
Set the property corresponding toAttributes.getMultiExitDisc()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setOrigin
Set the property corresponding toAttributes.getOrigin()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setOriginatorId
Set the property corresponding toAttributes.getOriginatorId()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setUnrecognizedAttributes
public AttributesBuilder setUnrecognizedAttributes(Map<UnrecognizedAttributesKey, UnrecognizedAttributes> values) Set the property corresponding toAttributes.getUnrecognizedAttributes()to the specified value.- Parameters:
values- desired value- Returns:
- this builder
-
build
Returns A newAttributesinstance.- Returns:
- A new
Attributesinstance
-