Package org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.snatint.ip.port.map
Class IntipPortMapBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.snatint.ip.port.map.IntipPortMapBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<IntipPortMap>
,org.opendaylight.yangtools.concepts.CheckedBuilder<IntipPortMap,java.lang.IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class IntipPortMapBuilder extends java.lang.Object implements org.opendaylight.yangtools.concepts.Builder<IntipPortMap>
Class that buildsIntipPortMapBuilder
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:
IntipPortMapBuilder createTarget(int fooXyzzy, int barBaz) { return new IntipPortMapBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of IntipPortMapBuilder, 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:
IntipPortMapBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description IntipPortMapBuilder()
IntipPortMapBuilder(IntipPortMap base)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IntipPortMapBuilder
addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap>>
E$$augmentation(java.lang.Class<E$$> augmentationType)
IntipPortMap
build()
java.util.List<IpPort>
getIpPort()
org.opendaylight.yangtools.yang.common.Uint32
getRouterId()
IntipPortMapKey
key()
IntipPortMapBuilder
removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap>> augmentationType)
IntipPortMapBuilder
setIpPort(java.util.List<IpPort> values)
IntipPortMapBuilder
setRouterId(java.lang.Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setRouterId(Uint32)} instead.IntipPortMapBuilder
setRouterId(org.opendaylight.yangtools.yang.common.Uint32 value)
IntipPortMapBuilder
withKey(IntipPortMapKey key)
-
-
-
Constructor Detail
-
IntipPortMapBuilder
public IntipPortMapBuilder()
-
IntipPortMapBuilder
public IntipPortMapBuilder(IntipPortMap base)
-
-
Method Detail
-
key
public IntipPortMapKey key()
-
getIpPort
public java.util.List<IpPort> getIpPort()
-
getRouterId
public org.opendaylight.yangtools.yang.common.Uint32 getRouterId()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
withKey
public IntipPortMapBuilder withKey(IntipPortMapKey key)
-
setIpPort
public IntipPortMapBuilder setIpPort(java.util.List<IpPort> values)
-
setRouterId
public IntipPortMapBuilder setRouterId(org.opendaylight.yangtools.yang.common.Uint32 value)
-
setRouterId
@Deprecated(forRemoval=true) public IntipPortMapBuilder setRouterId(java.lang.Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setRouterId(Uint32)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
addAugmentation
public IntipPortMapBuilder addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap> augmentationValue)
-
removeAugmentation
public IntipPortMapBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<IntipPortMap>> augmentationType)
-
build
public IntipPortMap build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<IntipPortMap>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<IntipPortMap,java.lang.IllegalArgumentException>
-
-