Package org.opendaylight.yang.gen.v1.urn.opendaylight.genius.cloudscaler.rpcs.rev171220.compute.nodes
Class ComputeNodeBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.genius.cloudscaler.rpcs.rev171220.compute.nodes.ComputeNodeBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<ComputeNode>
,org.opendaylight.yangtools.concepts.CheckedBuilder<ComputeNode,java.lang.IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
@Generated("mdsal-binding-generator") public class ComputeNodeBuilder extends java.lang.Object implements org.opendaylight.yangtools.concepts.Builder<ComputeNode>
Class that buildsComputeNodeBuilder
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:
ComputeNodeBuilder createTarget(int fooXyzzy, int barBaz) { return new ComputeNodeBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of ComputeNodeBuilder, 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:
ComputeNodeBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description ComputeNodeBuilder()
ComputeNodeBuilder(ComputeNode base)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ComputeNodeBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<ComputeNode> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ComputeNode>>
E$$augmentation(java.lang.Class<E$$> augmentationType)
ComputeNode
build()
java.lang.String
getComputeName()
org.opendaylight.yangtools.yang.common.Uint64
getDpnid()
java.lang.String
getNodeid()
java.lang.Boolean
getTombstoned()
java.lang.Boolean
isTombstoned()
Deprecated, for removal: This API element is subject to removal in a future version.ComputeNodeKey
key()
ComputeNodeBuilder
removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ComputeNode>> augmentationType)
Remove an augmentation from this builder's product.ComputeNodeBuilder
setComputeName(java.lang.String value)
ComputeNodeBuilder
setDpnid(java.math.BigInteger value)
Deprecated, for removal: This API element is subject to removal in a future version.UsesetDpnid(Uint64)
instead.ComputeNodeBuilder
setDpnid(org.opendaylight.yangtools.yang.common.Uint64 value)
ComputeNodeBuilder
setNodeid(java.lang.String value)
ComputeNodeBuilder
setTombstoned(java.lang.Boolean value)
ComputeNodeBuilder
withKey(ComputeNodeKey key)
-
-
-
Constructor Detail
-
ComputeNodeBuilder
public ComputeNodeBuilder()
-
ComputeNodeBuilder
public ComputeNodeBuilder(ComputeNode base)
-
-
Method Detail
-
key
public ComputeNodeKey key()
-
getComputeName
public java.lang.String getComputeName()
-
getDpnid
public org.opendaylight.yangtools.yang.common.Uint64 getDpnid()
-
getNodeid
public java.lang.String getNodeid()
-
getTombstoned
public java.lang.Boolean getTombstoned()
-
isTombstoned
@Deprecated(forRemoval=true) public final java.lang.Boolean isTombstoned()
Deprecated, for removal: This API element is subject to removal in a future version.
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ComputeNode>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
withKey
public ComputeNodeBuilder withKey(ComputeNodeKey key)
-
setComputeName
public ComputeNodeBuilder setComputeName(java.lang.String value)
-
setDpnid
public ComputeNodeBuilder setDpnid(org.opendaylight.yangtools.yang.common.Uint64 value)
-
setDpnid
@Deprecated(forRemoval=true) public ComputeNodeBuilder setDpnid(java.math.BigInteger value)
Deprecated, for removal: This API element is subject to removal in a future version.UsesetDpnid(Uint64)
instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setNodeid
public ComputeNodeBuilder setNodeid(java.lang.String value)
-
setTombstoned
public ComputeNodeBuilder setTombstoned(java.lang.Boolean value)
-
addAugmentation
public ComputeNodeBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<ComputeNode> augmentation)
Add an augmentation to this builder's product.- Parameters:
augmentation
- augmentation to be added- Returns:
- this builder
- Throws:
java.lang.NullPointerException
- ifaugmentation
is null
-
removeAugmentation
public ComputeNodeBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ComputeNode>> augmentationType)
Remove an augmentation from this builder's product. If this builder does not track such an augmentation type, this method does nothing.- Parameters:
augmentationType
- augmentation type to be removed- Returns:
- this builder
-
build
public ComputeNode build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<ComputeNode>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<ComputeNode,java.lang.IllegalArgumentException>
-
-