Class SessionCaseBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message.pcerr.message.error.type.SessionCaseBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<SessionCase>
,org.opendaylight.yangtools.concepts.CheckedBuilder<SessionCase,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class SessionCaseBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<SessionCase>
Class that buildsSessionCaseBuilder
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:
SessionCaseBuilder createTarget(int fooXyzzy, int barBaz) { return new SessionCaseBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of SessionCaseBuilder, 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:
SessionCaseBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description SessionCaseBuilder()
SessionCaseBuilder(SessionCase base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionCaseBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase>>
E$$augmentation(Class<E$$> augmentationType)
SessionCase
build()
Session
getSession()
SessionCaseBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase>> augmentationType)
SessionCaseBuilder
setSession(Session value)
-
-
-
Constructor Detail
-
SessionCaseBuilder
public SessionCaseBuilder()
-
SessionCaseBuilder
public SessionCaseBuilder(SessionCase base)
-
-
Method Detail
-
getSession
public Session getSession()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase>> E$$ augmentation(Class<E$$> augmentationType)
-
setSession
public SessionCaseBuilder setSession(Session value)
-
addAugmentation
public SessionCaseBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase> augmentationValue)
-
removeAugmentation
public SessionCaseBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SessionCase>> augmentationType)
-
build
public SessionCase build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<SessionCase>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<SessionCase,IllegalArgumentException>
-
-