Class TableConnectionBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.network.instance.rev151018.network.instance.top.network.instances.network.instance.table.connections.TableConnectionBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<TableConnection>
,org.opendaylight.yangtools.concepts.CheckedBuilder<TableConnection,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class TableConnectionBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<TableConnection>
Class that buildsTableConnectionBuilder
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:
TableConnectionBuilder createTarget(int fooXyzzy, int barBaz) { return new TableConnectionBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of TableConnectionBuilder, 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:
TableConnectionBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description TableConnectionBuilder()
TableConnectionBuilder(TableConnection base)
TableConnectionBuilder(ApplyPolicyGroup arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TableConnectionBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection>>
E$$augmentation(Class<E$$> augmentationType)
TableConnection
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.ApplyPolicy
getApplyPolicy()
Config
getConfig()
String
getDstTable()
String
getSrcTable()
State
getState()
TableConnectionKey
key()
TableConnectionBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection>> augmentationType)
TableConnectionBuilder
setApplyPolicy(ApplyPolicy value)
TableConnectionBuilder
setConfig(Config value)
TableConnectionBuilder
setDstTable(String value)
TableConnectionBuilder
setSrcTable(String value)
TableConnectionBuilder
setState(State value)
TableConnectionBuilder
withKey(TableConnectionKey key)
-
-
-
Constructor Detail
-
TableConnectionBuilder
public TableConnectionBuilder()
-
TableConnectionBuilder
public TableConnectionBuilder(ApplyPolicyGroup arg)
-
TableConnectionBuilder
public TableConnectionBuilder(TableConnection 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.http.openconfig.net.yang.routing.policy.rev151009.ApplyPolicyGroup
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
key
public TableConnectionKey key()
-
getApplyPolicy
public ApplyPolicy getApplyPolicy()
-
getConfig
public Config getConfig()
-
getDstTable
public String getDstTable()
-
getSrcTable
public String getSrcTable()
-
getState
public State getState()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection>> E$$ augmentation(Class<E$$> augmentationType)
-
withKey
public TableConnectionBuilder withKey(TableConnectionKey key)
-
setApplyPolicy
public TableConnectionBuilder setApplyPolicy(ApplyPolicy value)
-
setConfig
public TableConnectionBuilder setConfig(Config value)
-
setDstTable
public TableConnectionBuilder setDstTable(String value)
-
setSrcTable
public TableConnectionBuilder setSrcTable(String value)
-
setState
public TableConnectionBuilder setState(State value)
-
addAugmentation
public TableConnectionBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection> augmentationValue)
-
removeAugmentation
public TableConnectionBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<TableConnection>> augmentationType)
-
build
public TableConnection build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<TableConnection>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<TableConnection,IllegalArgumentException>
-
-