public class TunnelBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Tunnel>
TunnelBuilder
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:
TunnelBuilder createTarget(int fooXyzzy, int barBaz) {
return new TunnelBuilderBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of TunnelBuilder, as instances can be freely passed around without worrying about synchronization issues.
As a side note: method chaining results in:
build()
, which is then returned from the methodTunnelBuilder
,
Builder
Constructor and Description |
---|
TunnelBuilder() |
TunnelBuilder(Tunnel base) |
TunnelBuilder(TunnelTypeAttributes arg) |
Modifier and Type | Method and Description |
---|---|
Tunnel |
build() |
void |
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.
|
Class<? extends TunnelTypeBase> |
getTunnelType() |
TunnelBuilder |
setTunnelType(Class<? extends TunnelTypeBase> value) |
public TunnelBuilder()
public TunnelBuilder(TunnelTypeAttributes arg)
public TunnelBuilder(Tunnel base)
public void fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
arg
- grouping objectIllegalArgumentException
- if given argument is none of valid typespublic Class<? extends TunnelTypeBase> getTunnelType()
public TunnelBuilder setTunnelType(Class<? extends TunnelTypeBase> value)
public Tunnel build()
build
in interface org.opendaylight.yangtools.concepts.CheckedBuilder<Tunnel,IllegalArgumentException>
Copyright © 2019 OpenDaylight. All rights reserved.