Class NetworkConfigBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.genius.networkutils.config.rev181129.NetworkConfigBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<NetworkConfig>
,org.opendaylight.yangtools.concepts.CheckedBuilder<NetworkConfig,java.lang.IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class NetworkConfigBuilder extends java.lang.Object implements org.opendaylight.yangtools.concepts.Builder<NetworkConfig>
Class that buildsNetworkConfigBuilder
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:
NetworkConfigBuilder createTarget(int fooXyzzy, int barBaz) { return new NetworkConfigBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of NetworkConfigBuilder, 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:
NetworkConfigBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description NetworkConfigBuilder()
NetworkConfigBuilder(NetworkConfig base)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NetworkConfigBuilder
addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig>>
E$$augmentation(java.lang.Class<E$$> augmentationType)
NetworkConfig
build()
org.opendaylight.yangtools.yang.common.Uint32
getOpendaylightRdCount()
java.lang.String
getOpendaylightRdStartValue()
java.lang.String
getOpendaylightVniRanges()
NetworkConfigBuilder
removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig>> augmentationType)
NetworkConfigBuilder
setOpendaylightRdCount(java.lang.Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setOpendaylightRdCount(Uint32)} instead.NetworkConfigBuilder
setOpendaylightRdCount(org.opendaylight.yangtools.yang.common.Uint32 value)
NetworkConfigBuilder
setOpendaylightRdStartValue(java.lang.String value)
NetworkConfigBuilder
setOpendaylightVniRanges(java.lang.String value)
-
-
-
Constructor Detail
-
NetworkConfigBuilder
public NetworkConfigBuilder()
-
NetworkConfigBuilder
public NetworkConfigBuilder(NetworkConfig base)
-
-
Method Detail
-
getOpendaylightRdCount
public org.opendaylight.yangtools.yang.common.Uint32 getOpendaylightRdCount()
-
getOpendaylightRdStartValue
public java.lang.String getOpendaylightRdStartValue()
-
getOpendaylightVniRanges
public java.lang.String getOpendaylightVniRanges()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
setOpendaylightRdCount
public NetworkConfigBuilder setOpendaylightRdCount(org.opendaylight.yangtools.yang.common.Uint32 value)
-
setOpendaylightRdCount
@Deprecated(forRemoval=true) public NetworkConfigBuilder setOpendaylightRdCount(java.lang.Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setOpendaylightRdCount(Uint32)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setOpendaylightRdStartValue
public NetworkConfigBuilder setOpendaylightRdStartValue(java.lang.String value)
-
setOpendaylightVniRanges
public NetworkConfigBuilder setOpendaylightVniRanges(java.lang.String value)
-
addAugmentation
public NetworkConfigBuilder addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig> augmentationValue)
-
removeAugmentation
public NetworkConfigBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NetworkConfig>> augmentationType)
-
build
public NetworkConfig build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<NetworkConfig>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<NetworkConfig,java.lang.IllegalArgumentException>
-
-