Class ThreadsBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.ThreadsBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<Threads>
,org.opendaylight.yangtools.concepts.CheckedBuilder<Threads,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class ThreadsBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Threads>
Class that buildsThreadsBuilder
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:
ThreadsBuilder createTarget(int fooXyzzy, int barBaz) { return new ThreadsBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of ThreadsBuilder, 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:
ThreadsBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description ThreadsBuilder()
ThreadsBuilder(Threads base)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ThreadsBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Threads>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Threads> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Threads>>
E$$augmentation(Class<E$$> augmentationType)
Threads
build()
org.opendaylight.yangtools.yang.common.Uint16
getBossThreads()
org.opendaylight.yangtools.yang.common.Uint16
getWorkerThreads()
ThreadsBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Threads>> augmentationType)
ThreadsBuilder
setBossThreads(Integer value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setBossThreads(Uint16)} instead.ThreadsBuilder
setBossThreads(org.opendaylight.yangtools.yang.common.Uint16 value)
ThreadsBuilder
setWorkerThreads(Integer value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setWorkerThreads(Uint16)} instead.ThreadsBuilder
setWorkerThreads(org.opendaylight.yangtools.yang.common.Uint16 value)
-
-
-
Constructor Detail
-
ThreadsBuilder
public ThreadsBuilder()
-
ThreadsBuilder
public ThreadsBuilder(Threads base)
-
-
Method Detail
-
getBossThreads
public org.opendaylight.yangtools.yang.common.Uint16 getBossThreads()
-
getWorkerThreads
public org.opendaylight.yangtools.yang.common.Uint16 getWorkerThreads()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Threads>> E$$ augmentation(Class<E$$> augmentationType)
-
setBossThreads
public ThreadsBuilder setBossThreads(org.opendaylight.yangtools.yang.common.Uint16 value)
-
setBossThreads
@Deprecated(forRemoval=true) public ThreadsBuilder setBossThreads(Integer value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setBossThreads(Uint16)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setWorkerThreads
public ThreadsBuilder setWorkerThreads(org.opendaylight.yangtools.yang.common.Uint16 value)
-
setWorkerThreads
@Deprecated(forRemoval=true) public ThreadsBuilder setWorkerThreads(Integer value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setWorkerThreads(Uint16)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
addAugmentation
public ThreadsBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Threads>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Threads> augmentationValue)
-
removeAugmentation
public ThreadsBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Threads>> augmentationType)
-
build
public Threads build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<Threads>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<Threads,IllegalArgumentException>
-
-