Class SrcBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.SrcBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<Src>,org.opendaylight.yangtools.concepts.CheckedBuilder<Src,IllegalArgumentException>,org.opendaylight.yangtools.concepts.Mutable,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class SrcBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Src>
Class that buildsSrcBuilderinstances. 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:
SrcBuilder createTarget(int fooXyzzy, int barBaz) { return new SrcBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }This pattern is supported by the immutable nature of SrcBuilder, 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:
SrcBuilder,Builder
-
-
Constructor Summary
Constructors Constructor Description SrcBuilder()SrcBuilder(Src base)SrcBuilder(RangeGrouping arg)SrcBuilder(SrcChoiceGrouping arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SrcBuilderaddAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Src>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Src> augmentationValue)<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Src>>
E$$augmentation(Class<E$$> augmentationType)Srcbuild()voidfieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)Set fields from given grouping argument.org.opendaylight.yangtools.yang.common.Uint16getEnd()SrcChoicegetSrcChoice()org.opendaylight.yangtools.yang.common.Uint16getStart()SrcBuilderremoveAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Src>> augmentationType)SrcBuildersetEnd(Integer value)Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setEnd(Uint16)} instead.SrcBuildersetEnd(org.opendaylight.yangtools.yang.common.Uint16 value)SrcBuildersetSrcChoice(SrcChoice value)SrcBuildersetStart(Integer value)Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setStart(Uint16)} instead.SrcBuildersetStart(org.opendaylight.yangtools.yang.common.Uint16 value)
-
-
-
Constructor Detail
-
SrcBuilder
public SrcBuilder()
-
SrcBuilder
public SrcBuilder(SrcChoiceGrouping arg)
-
SrcBuilder
public SrcBuilder(RangeGrouping arg)
-
SrcBuilder
public SrcBuilder(Src 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.openflowplugin.extension.nicira.action.rev140714.SrcChoiceGrouping
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.RangeGrouping
- Parameters:
arg- grouping object- Throws:
IllegalArgumentException- if given argument is none of valid types
-
getEnd
public org.opendaylight.yangtools.yang.common.Uint16 getEnd()
-
getSrcChoice
public SrcChoice getSrcChoice()
-
getStart
public org.opendaylight.yangtools.yang.common.Uint16 getStart()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Src>> E$$ augmentation(Class<E$$> augmentationType)
-
setEnd
public SrcBuilder setEnd(org.opendaylight.yangtools.yang.common.Uint16 value)
-
setEnd
@Deprecated(forRemoval=true) public SrcBuilder setEnd(Integer value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setEnd(Uint16)} instead.Utility migration setter.- Parameters:
value- field value in legacy type- Returns:
- this builder
-
setSrcChoice
public SrcBuilder setSrcChoice(SrcChoice value)
-
setStart
public SrcBuilder setStart(org.opendaylight.yangtools.yang.common.Uint16 value)
-
setStart
@Deprecated(forRemoval=true) public SrcBuilder setStart(Integer value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setStart(Uint16)} instead.Utility migration setter.- Parameters:
value- field value in legacy type- Returns:
- this builder
-
addAugmentation
public SrcBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Src>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Src> augmentationValue)
-
removeAugmentation
public SrcBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Src>> augmentationType)
-
build
public Src build()
- Specified by:
buildin interfaceorg.opendaylight.yangtools.concepts.Builder<Src>- Specified by:
buildin interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<Src,IllegalArgumentException>
-
-