Class InterVpnLinkStateBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.InterVpnLinkStateBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<InterVpnLinkState>
,org.opendaylight.yangtools.concepts.CheckedBuilder<InterVpnLinkState,java.lang.IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class InterVpnLinkStateBuilder extends java.lang.Object implements org.opendaylight.yangtools.concepts.Builder<InterVpnLinkState>
Class that buildsInterVpnLinkStateBuilder
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:
InterVpnLinkStateBuilder createTarget(int fooXyzzy, int barBaz) { return new InterVpnLinkStateBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of InterVpnLinkStateBuilder, 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:
InterVpnLinkStateBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description InterVpnLinkStateBuilder()
InterVpnLinkStateBuilder(InterVpnLinkState base)
-
Method Summary
-
-
-
Constructor Detail
-
InterVpnLinkStateBuilder
public InterVpnLinkStateBuilder()
-
InterVpnLinkStateBuilder
public InterVpnLinkStateBuilder(InterVpnLinkState base)
-
-
Method Detail
-
key
public InterVpnLinkStateKey key()
-
getErrorDescription
public java.lang.String getErrorDescription()
-
getFirstEndpointState
public FirstEndpointState getFirstEndpointState()
-
getInterVpnLinkName
public java.lang.String getInterVpnLinkName()
-
getSecondEndpointState
public SecondEndpointState getSecondEndpointState()
-
getState
public InterVpnLinkState.State getState()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<InterVpnLinkState>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
withKey
public InterVpnLinkStateBuilder withKey(InterVpnLinkStateKey key)
-
setErrorDescription
public InterVpnLinkStateBuilder setErrorDescription(java.lang.String value)
-
setFirstEndpointState
public InterVpnLinkStateBuilder setFirstEndpointState(FirstEndpointState value)
-
setInterVpnLinkName
public InterVpnLinkStateBuilder setInterVpnLinkName(java.lang.String value)
-
setSecondEndpointState
public InterVpnLinkStateBuilder setSecondEndpointState(SecondEndpointState value)
-
setState
public InterVpnLinkStateBuilder setState(InterVpnLinkState.State value)
-
addAugmentation
public InterVpnLinkStateBuilder addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<InterVpnLinkState>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<InterVpnLinkState> augmentationValue)
-
removeAugmentation
public InterVpnLinkStateBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<InterVpnLinkState>> augmentationType)
-
build
public InterVpnLinkState build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<InterVpnLinkState>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<InterVpnLinkState,java.lang.IllegalArgumentException>
-
-