Class SrRroTypeBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<SrRroType>
,org.opendaylight.yangtools.concepts.CheckedBuilder<SrRroType,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class SrRroTypeBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<SrRroType>
Class that buildsSrRroTypeBuilder
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:
SrRroTypeBuilder createTarget(int fooXyzzy, int barBaz) { return new SrRroTypeBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of SrRroTypeBuilder, 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:
SrRroTypeBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description SrRroTypeBuilder()
SrRroTypeBuilder(SrRroType base)
SrRroTypeBuilder(SrRroSubobject arg)
SrRroTypeBuilder(SrSubobject arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SrRroTypeBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType>>
E$$augmentation(Class<E$$> augmentationType)
SrRroType
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.Nai
getNai()
org.opendaylight.yangtools.yang.common.Uint32
getSid()
SidType
getSidType()
Boolean
isCFlag()
Boolean
isMFlag()
SrRroTypeBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType>> augmentationType)
SrRroTypeBuilder
setCFlag(Boolean value)
SrRroTypeBuilder
setMFlag(Boolean value)
SrRroTypeBuilder
setNai(Nai value)
SrRroTypeBuilder
setSid(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setSid(Uint32)} instead.SrRroTypeBuilder
setSid(org.opendaylight.yangtools.yang.common.Uint32 value)
SrRroTypeBuilder
setSidType(SidType value)
-
-
-
Constructor Detail
-
SrRroTypeBuilder
public SrRroTypeBuilder()
-
SrRroTypeBuilder
public SrRroTypeBuilder(SrRroSubobject arg)
-
SrRroTypeBuilder
public SrRroTypeBuilder(SrSubobject arg)
-
SrRroTypeBuilder
public SrRroTypeBuilder(SrRroType base)
-
-
Method Detail
-
fieldsFrom
public void fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument. Valid argument is instance of one of following types:- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.SrSubobject
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.SrRroSubobject
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getNai
public Nai getNai()
-
getSid
public org.opendaylight.yangtools.yang.common.Uint32 getSid()
-
getSidType
public SidType getSidType()
-
isCFlag
public Boolean isCFlag()
-
isMFlag
public Boolean isMFlag()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType>> E$$ augmentation(Class<E$$> augmentationType)
-
setNai
public SrRroTypeBuilder setNai(Nai value)
-
setSid
public SrRroTypeBuilder setSid(org.opendaylight.yangtools.yang.common.Uint32 value)
-
setSid
@Deprecated(forRemoval=true) public SrRroTypeBuilder setSid(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setSid(Uint32)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setSidType
public SrRroTypeBuilder setSidType(SidType value)
-
setCFlag
public SrRroTypeBuilder setCFlag(Boolean value)
-
setMFlag
public SrRroTypeBuilder setMFlag(Boolean value)
-
addAugmentation
public SrRroTypeBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType> augmentationValue)
-
removeAugmentation
public SrRroTypeBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<SrRroType>> augmentationType)
-
build
public SrRroType build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<SrRroType>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<SrRroType,IllegalArgumentException>
-
-