Class PrefixAttributesBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.path.attribute.link.state.attribute.prefix.attributes._case.PrefixAttributesBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<PrefixAttributes>
,org.opendaylight.yangtools.concepts.CheckedBuilder<PrefixAttributes,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class PrefixAttributesBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<PrefixAttributes>
Class that buildsPrefixAttributesBuilder
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:
PrefixAttributesBuilder createTarget(int fooXyzzy, int barBaz) { return new PrefixAttributesBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of PrefixAttributesBuilder, 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 oportunities, 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:
PrefixAttributesBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description PrefixAttributesBuilder()
PrefixAttributesBuilder(PrefixAttributes base)
PrefixAttributesBuilder(PrefixState arg)
-
Method Summary
-
-
-
Constructor Detail
-
PrefixAttributesBuilder
public PrefixAttributesBuilder()
-
PrefixAttributesBuilder
public PrefixAttributesBuilder(PrefixState arg)
-
PrefixAttributesBuilder
public PrefixAttributesBuilder(PrefixAttributes base)
-
-
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:- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.PrefixState
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getExtendedTags
public List<ExtendedRouteTag> getExtendedTags()
-
getIgpBits
public IgpBits getIgpBits()
-
getIpv6SrPrefix
public Ipv6SrPrefix getIpv6SrPrefix()
-
getOspfForwardingAddress
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone getOspfForwardingAddress()
-
getPrefixMetric
public IgpMetric getPrefixMetric()
-
getSrBindingSidLabels
public List<SrBindingSidLabels> getSrBindingSidLabels()
-
getSrPrefix
public SrPrefix getSrPrefix()
-
getSrRange
public SrRange getSrRange()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<PrefixAttributes>> E$$ augmentation(Class<E$$> augmentationType)
-
setExtendedTags
public PrefixAttributesBuilder setExtendedTags(List<ExtendedRouteTag> values)
-
setIgpBits
public PrefixAttributesBuilder setIgpBits(IgpBits value)
-
setIpv6SrPrefix
public PrefixAttributesBuilder setIpv6SrPrefix(Ipv6SrPrefix value)
-
setOspfForwardingAddress
public PrefixAttributesBuilder setOspfForwardingAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone value)
-
setPrefixMetric
public PrefixAttributesBuilder setPrefixMetric(IgpMetric value)
-
setRouteTags
public PrefixAttributesBuilder setRouteTags(List<RouteTag> values)
-
setSrBindingSidLabels
public PrefixAttributesBuilder setSrBindingSidLabels(List<SrBindingSidLabels> values)
-
setSrPrefix
public PrefixAttributesBuilder setSrPrefix(SrPrefix value)
-
setSrRange
public PrefixAttributesBuilder setSrRange(SrRange value)
-
addAugmentation
public PrefixAttributesBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<PrefixAttributes>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<PrefixAttributes> augmentationValue)
-
removeAugmentation
public PrefixAttributesBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<PrefixAttributes>> augmentationType)
-
build
public PrefixAttributes build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<PrefixAttributes>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<PrefixAttributes,IllegalArgumentException>
-
-