Class NxActionMultipathBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder
-
@Generated("mdsal-binding-generator") public class NxActionMultipathBuilder extends Object
Class that buildsNxActionMultipath
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:
NxActionMultipath createNxActionMultipath(int fooXyzzy, int barBaz) { return new NxActionMultipathBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of NxActionMultipath, 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:
NxActionMultipath
- 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 NxActionMultipathBuilder()
Construct an empty builder.NxActionMultipathBuilder(NxActionMultipath base)
Construct a builder initialized with state from specifiedNxActionMultipath
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NxActionMultipathBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<NxActionMultipath> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<NxActionMultipath>>
E$$augmentation(Class<E$$> augmentationType)
Return the specified augmentation, if it is present in this builder.@NonNull NxActionMultipath
build()
A newNxActionMultipath
instance.OfjNxMpAlgorithm
getAlgorithm()
Return current value associated with the property corresponding toNxActionMultipath.getAlgorithm()
.org.opendaylight.yangtools.yang.common.Uint32
getArg()
Return current value associated with the property corresponding toNxActionMultipath.getArg()
.org.opendaylight.yangtools.yang.common.Uint16
getBasis()
Return current value associated with the property corresponding toNxActionMultipath.getBasis()
.org.opendaylight.yangtools.yang.common.Uint32
getDst()
Return current value associated with the property corresponding toNxActionMultipath.getDst()
.ExperimenterId
getExperimenterId()
Return current value associated with the property corresponding toNxActionMultipath.getExperimenterId()
.OfjNxHashFields
getFields()
Return current value associated with the property corresponding toNxActionMultipath.getFields()
.org.opendaylight.yangtools.yang.common.Uint16
getMaxLink()
Return current value associated with the property corresponding toNxActionMultipath.getMaxLink()
.org.opendaylight.yangtools.yang.common.Uint16
getOfsNbits()
Return current value associated with the property corresponding toNxActionMultipath.getOfsNbits()
.NxActionMultipathBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NxActionMultipath>> augmentationType)
Remove an augmentation from this builder's product.NxActionMultipathBuilder
setAlgorithm(OfjNxMpAlgorithm value)
Set the property corresponding toNxActionMultipath.getAlgorithm()
to the specified value.NxActionMultipathBuilder
setArg(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toNxActionMultipath.getArg()
to the specified value.NxActionMultipathBuilder
setBasis(org.opendaylight.yangtools.yang.common.Uint16 value)
Set the property corresponding toNxActionMultipath.getBasis()
to the specified value.NxActionMultipathBuilder
setDst(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toNxActionMultipath.getDst()
to the specified value.NxActionMultipathBuilder
setExperimenterId(ExperimenterId value)
Set the property corresponding toNxActionMultipath.getExperimenterId()
to the specified value.NxActionMultipathBuilder
setFields(OfjNxHashFields value)
Set the property corresponding toNxActionMultipath.getFields()
to the specified value.NxActionMultipathBuilder
setMaxLink(org.opendaylight.yangtools.yang.common.Uint16 value)
Set the property corresponding toNxActionMultipath.getMaxLink()
to the specified value.NxActionMultipathBuilder
setOfsNbits(org.opendaylight.yangtools.yang.common.Uint16 value)
Set the property corresponding toNxActionMultipath.getOfsNbits()
to the specified value.
-
-
-
Constructor Detail
-
NxActionMultipathBuilder
public NxActionMultipathBuilder()
Construct an empty builder.
-
NxActionMultipathBuilder
public NxActionMultipathBuilder(NxActionMultipath base)
Construct a builder initialized with state from specifiedNxActionMultipath
.- Parameters:
base
- NxActionMultipath from which the builder should be initialized
-
-
Method Detail
-
getAlgorithm
public OfjNxMpAlgorithm getAlgorithm()
Return current value associated with the property corresponding toNxActionMultipath.getAlgorithm()
.- Returns:
- current value
-
getArg
public org.opendaylight.yangtools.yang.common.Uint32 getArg()
Return current value associated with the property corresponding toNxActionMultipath.getArg()
.- Returns:
- current value
-
getBasis
public org.opendaylight.yangtools.yang.common.Uint16 getBasis()
Return current value associated with the property corresponding toNxActionMultipath.getBasis()
.- Returns:
- current value
-
getDst
public org.opendaylight.yangtools.yang.common.Uint32 getDst()
Return current value associated with the property corresponding toNxActionMultipath.getDst()
.- Returns:
- current value
-
getExperimenterId
public ExperimenterId getExperimenterId()
Return current value associated with the property corresponding toNxActionMultipath.getExperimenterId()
.- Returns:
- current value
-
getFields
public OfjNxHashFields getFields()
Return current value associated with the property corresponding toNxActionMultipath.getFields()
.- Returns:
- current value
-
getMaxLink
public org.opendaylight.yangtools.yang.common.Uint16 getMaxLink()
Return current value associated with the property corresponding toNxActionMultipath.getMaxLink()
.- Returns:
- current value
-
getOfsNbits
public org.opendaylight.yangtools.yang.common.Uint16 getOfsNbits()
Return current value associated with the property corresponding toNxActionMultipath.getOfsNbits()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<NxActionMultipath>> 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
-
setAlgorithm
public NxActionMultipathBuilder setAlgorithm(OfjNxMpAlgorithm value)
Set the property corresponding toNxActionMultipath.getAlgorithm()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setArg
public NxActionMultipathBuilder setArg(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toNxActionMultipath.getArg()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setBasis
public NxActionMultipathBuilder setBasis(org.opendaylight.yangtools.yang.common.Uint16 value)
Set the property corresponding toNxActionMultipath.getBasis()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDst
public NxActionMultipathBuilder setDst(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toNxActionMultipath.getDst()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setExperimenterId
public NxActionMultipathBuilder setExperimenterId(ExperimenterId value)
Set the property corresponding toNxActionMultipath.getExperimenterId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setFields
public NxActionMultipathBuilder setFields(OfjNxHashFields value)
Set the property corresponding toNxActionMultipath.getFields()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMaxLink
public NxActionMultipathBuilder setMaxLink(org.opendaylight.yangtools.yang.common.Uint16 value)
Set the property corresponding toNxActionMultipath.getMaxLink()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setOfsNbits
public NxActionMultipathBuilder setOfsNbits(org.opendaylight.yangtools.yang.common.Uint16 value)
Set the property corresponding toNxActionMultipath.getOfsNbits()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public NxActionMultipathBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<NxActionMultipath> 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 NxActionMultipathBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NxActionMultipath>> 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 NxActionMultipath build()
A newNxActionMultipath
instance.- Returns:
- A new
NxActionMultipath
instance.
-
-