Class TeLspAttributesBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.path.attribute.link.state.attribute.te.lsp.attributes._case.TeLspAttributesBuilder
Class that builds
TeLspAttributes
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:
TeLspAttributes createTeLspAttributes(int fooXyzzy, int barBaz) {
return new TeLspAttributesBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of TeLspAttributes, 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 specifiedTeLspAttributes
.Construct a new builder initialized from specifiedAdminStatusObject
.Construct a new builder initialized from specifiedAssociationObject
.Construct a new builder initialized from specifiedBandwidthObject
.Construct a new builder initialized from specifiedDetourObject
.Construct a new builder initialized from specifiedExcludeRouteObject
.Construct a new builder initialized from specifiedExplicitRouteObject
.Construct a new builder initialized from specifiedFastRerouteObject
.Construct a new builder initialized from specifiedFlowSpecObject
.Construct a new builder initialized from specifiedLspAttributesObject
.Construct a new builder initialized from specifiedLspRequiredAttributesObject
.Construct a new builder initialized from specifiedMetricObject
.Construct a new builder initialized from specifiedPrimaryPathRouteObject
.Construct a new builder initialized from specifiedProtectionObject
.Construct a new builder initialized from specifiedRecordRouteObject
.Construct a new builder initialized from specifiedSecondaryExplicitRouteObject
.Construct a new builder initialized from specifiedSecondaryRecordRouteObject
.Construct a new builder initialized from specifiedSessionAttributeObject
.Construct a new builder initialized from specifiedTspecObject
. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation
(org.opendaylight.yangtools.yang.binding.Augmentation<TeLspAttributes> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<TeLspAttributes>>
E$$augmentation
(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.@NonNull TeLspAttributes
build()
A newTeLspAttributes
instance.static @NonNull TeLspAttributes
empty()
Get empty instance of TeLspAttributes.void
fieldsFrom
(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.Return current value associated with the property corresponding toAdminStatusObject.getAdminStatusObject()
.Return current value associated with the property corresponding toAssociationObject.getAssociationObject()
.Return current value associated with the property corresponding toBandwidthObject.getBandwidthObject()
.Return current value associated with the property corresponding toDetourObject.getDetourObject()
.Return current value associated with the property corresponding toExcludeRouteObject.getExcludeRouteObject()
.Return current value associated with the property corresponding toExplicitRouteObject.getExplicitRouteObject()
.Return current value associated with the property corresponding toFastRerouteObject.getFastRerouteObject()
.Return current value associated with the property corresponding toFlowSpecObject.getFlowSpecObject()
.Return current value associated with the property corresponding toLspAttributesObject.getLspAttributesObject()
.Return current value associated with the property corresponding toLspRequiredAttributesObject.getLspRequiredAttributesObject()
.Return current value associated with the property corresponding toMetricObject.getMetricObject()
.Return current value associated with the property corresponding toPrimaryPathRouteObject.getPrimaryPathRouteObject()
.Return current value associated with the property corresponding toProtectionObject.getProtectionObject()
.Return current value associated with the property corresponding toRecordRouteObject.getRecordRouteObject()
.Return current value associated with the property corresponding toSecondaryExplicitRouteObject.getSecondaryExplicitRouteObject()
.Return current value associated with the property corresponding toSecondaryRecordRouteObject.getSecondaryRecordRouteObject()
.Return current value associated with the property corresponding toSessionAttributeObject.getSessionAttributeObject()
.Return current value associated with the property corresponding toTspecObject.getTspecObject()
.removeAugmentation
(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<TeLspAttributes>> augmentationType) Remove an augmentation from this builder's product.Set the property corresponding toAdminStatusObject.getAdminStatusObject()
to the specified value.Set the property corresponding toAssociationObject.getAssociationObject()
to the specified value.Set the property corresponding toBandwidthObject.getBandwidthObject()
to the specified value.setDetourObject
(DetourObject value) Set the property corresponding toDetourObject.getDetourObject()
to the specified value.Set the property corresponding toExcludeRouteObject.getExcludeRouteObject()
to the specified value.Set the property corresponding toExplicitRouteObject.getExplicitRouteObject()
to the specified value.Set the property corresponding toFastRerouteObject.getFastRerouteObject()
to the specified value.setFlowSpecObject
(FlowSpecObject value) Set the property corresponding toFlowSpecObject.getFlowSpecObject()
to the specified value.Set the property corresponding toLspAttributesObject.getLspAttributesObject()
to the specified value.Set the property corresponding toLspRequiredAttributesObject.getLspRequiredAttributesObject()
to the specified value.setMetricObject
(MetricObject value) Set the property corresponding toMetricObject.getMetricObject()
to the specified value.Set the property corresponding toPrimaryPathRouteObject.getPrimaryPathRouteObject()
to the specified value.Set the property corresponding toProtectionObject.getProtectionObject()
to the specified value.Set the property corresponding toRecordRouteObject.getRecordRouteObject()
to the specified value.Set the property corresponding toSecondaryExplicitRouteObject.getSecondaryExplicitRouteObject()
to the specified value.Set the property corresponding toSecondaryRecordRouteObject.getSecondaryRecordRouteObject()
to the specified value.Set the property corresponding toSessionAttributeObject.getSessionAttributeObject()
to the specified value.setTspecObject
(TspecObject value) Set the property corresponding toTspecObject.getTspecObject()
to the specified value.
-
Constructor Details
-
TeLspAttributesBuilder
public TeLspAttributesBuilder()Construct an empty builder. -
TeLspAttributesBuilder
Construct a new builder initialized from specifiedTspecObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TspecObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedFlowSpecObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.FlowSpecObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedSessionAttributeObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.SessionAttributeObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedExplicitRouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.ExplicitRouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedSecondaryExplicitRouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.SecondaryExplicitRouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedRecordRouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RecordRouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedSecondaryRecordRouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.SecondaryRecordRouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedFastRerouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.FastRerouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedDetourObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.DetourObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedExcludeRouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.ExcludeRouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedLspAttributesObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspAttributesObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedLspRequiredAttributesObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspRequiredAttributesObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedProtectionObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.ProtectionObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedAssociationObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AssociationObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedPrimaryPathRouteObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.PrimaryPathRouteObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedAdminStatusObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AdminStatusObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedBandwidthObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.BandwidthObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a new builder initialized from specifiedMetricObject
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.MetricObject from which the builder should be initialized
-
TeLspAttributesBuilder
Construct a builder initialized with state from specifiedTeLspAttributes
.- Parameters:
base
- TeLspAttributes 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:SecondaryExplicitRouteObject
ExcludeRouteObject
ProtectionObject
SecondaryRecordRouteObject
LspRequiredAttributesObject
RecordRouteObject
TspecObject
AssociationObject
SessionAttributeObject
PrimaryPathRouteObject
BandwidthObject
FastRerouteObject
FlowSpecObject
DetourObject
AdminStatusObject
MetricObject
LspAttributesObject
ExplicitRouteObject
- 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 TeLspAttributes.- Returns:
- An empty
TeLspAttributes
-
getAdminStatusObject
Return current value associated with the property corresponding toAdminStatusObject.getAdminStatusObject()
.- Returns:
- current value
-
getAssociationObject
Return current value associated with the property corresponding toAssociationObject.getAssociationObject()
.- Returns:
- current value
-
getBandwidthObject
Return current value associated with the property corresponding toBandwidthObject.getBandwidthObject()
.- Returns:
- current value
-
getDetourObject
Return current value associated with the property corresponding toDetourObject.getDetourObject()
.- Returns:
- current value
-
getExcludeRouteObject
Return current value associated with the property corresponding toExcludeRouteObject.getExcludeRouteObject()
.- Returns:
- current value
-
getExplicitRouteObject
Return current value associated with the property corresponding toExplicitRouteObject.getExplicitRouteObject()
.- Returns:
- current value
-
getFastRerouteObject
Return current value associated with the property corresponding toFastRerouteObject.getFastRerouteObject()
.- Returns:
- current value
-
getFlowSpecObject
Return current value associated with the property corresponding toFlowSpecObject.getFlowSpecObject()
.- Returns:
- current value
-
getLspAttributesObject
Return current value associated with the property corresponding toLspAttributesObject.getLspAttributesObject()
.- Returns:
- current value
-
getLspRequiredAttributesObject
Return current value associated with the property corresponding toLspRequiredAttributesObject.getLspRequiredAttributesObject()
.- Returns:
- current value
-
getMetricObject
Return current value associated with the property corresponding toMetricObject.getMetricObject()
.- Returns:
- current value
-
getPrimaryPathRouteObject
Return current value associated with the property corresponding toPrimaryPathRouteObject.getPrimaryPathRouteObject()
.- Returns:
- current value
-
getProtectionObject
Return current value associated with the property corresponding toProtectionObject.getProtectionObject()
.- Returns:
- current value
-
getRecordRouteObject
Return current value associated with the property corresponding toRecordRouteObject.getRecordRouteObject()
.- Returns:
- current value
-
getSecondaryExplicitRouteObject
Return current value associated with the property corresponding toSecondaryExplicitRouteObject.getSecondaryExplicitRouteObject()
.- Returns:
- current value
-
getSecondaryRecordRouteObject
Return current value associated with the property corresponding toSecondaryRecordRouteObject.getSecondaryRecordRouteObject()
.- Returns:
- current value
-
getSessionAttributeObject
Return current value associated with the property corresponding toSessionAttributeObject.getSessionAttributeObject()
.- Returns:
- current value
-
getTspecObject
Return current value associated with the property corresponding toTspecObject.getTspecObject()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<TeLspAttributes>> 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
-
setAdminStatusObject
Set the property corresponding toAdminStatusObject.getAdminStatusObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setAssociationObject
Set the property corresponding toAssociationObject.getAssociationObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setBandwidthObject
Set the property corresponding toBandwidthObject.getBandwidthObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDetourObject
Set the property corresponding toDetourObject.getDetourObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setExcludeRouteObject
Set the property corresponding toExcludeRouteObject.getExcludeRouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setExplicitRouteObject
Set the property corresponding toExplicitRouteObject.getExplicitRouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setFastRerouteObject
Set the property corresponding toFastRerouteObject.getFastRerouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setFlowSpecObject
Set the property corresponding toFlowSpecObject.getFlowSpecObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLspAttributesObject
Set the property corresponding toLspAttributesObject.getLspAttributesObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLspRequiredAttributesObject
Set the property corresponding toLspRequiredAttributesObject.getLspRequiredAttributesObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMetricObject
Set the property corresponding toMetricObject.getMetricObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPrimaryPathRouteObject
Set the property corresponding toPrimaryPathRouteObject.getPrimaryPathRouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setProtectionObject
Set the property corresponding toProtectionObject.getProtectionObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRecordRouteObject
Set the property corresponding toRecordRouteObject.getRecordRouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSecondaryExplicitRouteObject
Set the property corresponding toSecondaryExplicitRouteObject.getSecondaryExplicitRouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSecondaryRecordRouteObject
Set the property corresponding toSecondaryRecordRouteObject.getSecondaryRecordRouteObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSessionAttributeObject
Set the property corresponding toSessionAttributeObject.getSessionAttributeObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTspecObject
Set the property corresponding toTspecObject.getTspecObject()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public TeLspAttributesBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<TeLspAttributes> 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 TeLspAttributesBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<TeLspAttributes>> 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 newTeLspAttributes
instance.- Returns:
- A new
TeLspAttributes
instance.
-