Class FlowHashIdMapBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMapBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<FlowHashIdMap>
,org.opendaylight.yangtools.concepts.CheckedBuilder<FlowHashIdMap,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class FlowHashIdMapBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<FlowHashIdMap>
Class that buildsFlowHashIdMapBuilder
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:
FlowHashIdMapBuilder createTarget(int fooXyzzy, int barBaz) { return new FlowHashIdMapBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of FlowHashIdMapBuilder, 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:
FlowHashIdMapBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description FlowHashIdMapBuilder()
FlowHashIdMapBuilder(FlowHashIdMap base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlowHashIdMapBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap>>
E$$augmentation(Class<E$$> augmentationType)
FlowHashIdMap
build()
FlowId
getFlowId()
String
getHash()
FlowHashIdMapKey
key()
FlowHashIdMapBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap>> augmentationType)
FlowHashIdMapBuilder
setFlowId(FlowId value)
FlowHashIdMapBuilder
setHash(String value)
FlowHashIdMapBuilder
withKey(FlowHashIdMapKey key)
-
-
-
Constructor Detail
-
FlowHashIdMapBuilder
public FlowHashIdMapBuilder()
-
FlowHashIdMapBuilder
public FlowHashIdMapBuilder(FlowHashIdMap base)
-
-
Method Detail
-
key
public FlowHashIdMapKey key()
-
getFlowId
public FlowId getFlowId()
-
getHash
public String getHash()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap>> E$$ augmentation(Class<E$$> augmentationType)
-
withKey
public FlowHashIdMapBuilder withKey(FlowHashIdMapKey key)
-
setFlowId
public FlowHashIdMapBuilder setFlowId(FlowId value)
-
setHash
public FlowHashIdMapBuilder setHash(String value)
-
addAugmentation
public FlowHashIdMapBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap> augmentationValue)
-
removeAugmentation
public FlowHashIdMapBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<FlowHashIdMap>> augmentationType)
-
build
public FlowHashIdMap build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<FlowHashIdMap>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<FlowHashIdMap,IllegalArgumentException>
-
-