Class ConstraintsBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.path.computation.rev200120.get.constrained.path.input.ConstraintsBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<Constraints>
,org.opendaylight.yangtools.concepts.CheckedBuilder<Constraints,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class ConstraintsBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Constraints>
Class that buildsConstraintsBuilder
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:
ConstraintsBuilder createTarget(int fooXyzzy, int barBaz) { return new ConstraintsBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of ConstraintsBuilder, 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:
ConstraintsBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description ConstraintsBuilder()
ConstraintsBuilder(Constraints base)
ConstraintsBuilder(PathConstraints arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ConstraintsBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Constraints>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Constraints> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Constraints>>
E$$augmentation(Class<E$$> augmentationType)
Constraints
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.PathConstraints.AddressFamily
getAddressFamily()
org.opendaylight.yangtools.yang.common.Uint32
getAdminGroup()
DecimalBandwidth
getBandwidth()
org.opendaylight.yangtools.yang.common.Uint8
getClassType()
Delay
getDelay()
Delay
getJitter()
Loss
getLoss()
org.opendaylight.yangtools.yang.common.Uint32
getMetric()
org.opendaylight.yangtools.yang.common.Uint32
getTeMetric()
ConstraintsBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Constraints>> augmentationType)
ConstraintsBuilder
setAddressFamily(PathConstraints.AddressFamily value)
ConstraintsBuilder
setAdminGroup(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setAdminGroup(Uint32)} instead.ConstraintsBuilder
setAdminGroup(org.opendaylight.yangtools.yang.common.Uint32 value)
ConstraintsBuilder
setBandwidth(DecimalBandwidth value)
ConstraintsBuilder
setClassType(Short value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setClassType(Uint8)} instead.ConstraintsBuilder
setClassType(org.opendaylight.yangtools.yang.common.Uint8 value)
ConstraintsBuilder
setDelay(Delay value)
ConstraintsBuilder
setJitter(Delay value)
ConstraintsBuilder
setLoss(Loss value)
ConstraintsBuilder
setMetric(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setMetric(Uint32)} instead.ConstraintsBuilder
setMetric(org.opendaylight.yangtools.yang.common.Uint32 value)
ConstraintsBuilder
setTeMetric(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setTeMetric(Uint32)} instead.ConstraintsBuilder
setTeMetric(org.opendaylight.yangtools.yang.common.Uint32 value)
-
-
-
Constructor Detail
-
ConstraintsBuilder
public ConstraintsBuilder()
-
ConstraintsBuilder
public ConstraintsBuilder(PathConstraints arg)
-
ConstraintsBuilder
public ConstraintsBuilder(Constraints 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.path.computation.rev200120.PathConstraints
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getAddressFamily
public PathConstraints.AddressFamily getAddressFamily()
-
getAdminGroup
public org.opendaylight.yangtools.yang.common.Uint32 getAdminGroup()
-
getBandwidth
public DecimalBandwidth getBandwidth()
-
getClassType
public org.opendaylight.yangtools.yang.common.Uint8 getClassType()
-
getDelay
public Delay getDelay()
-
getJitter
public Delay getJitter()
-
getLoss
public Loss getLoss()
-
getMetric
public org.opendaylight.yangtools.yang.common.Uint32 getMetric()
-
getTeMetric
public org.opendaylight.yangtools.yang.common.Uint32 getTeMetric()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Constraints>> E$$ augmentation(Class<E$$> augmentationType)
-
setAddressFamily
public ConstraintsBuilder setAddressFamily(PathConstraints.AddressFamily value)
-
setAdminGroup
public ConstraintsBuilder setAdminGroup(org.opendaylight.yangtools.yang.common.Uint32 value)
-
setAdminGroup
@Deprecated(forRemoval=true) public ConstraintsBuilder setAdminGroup(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setAdminGroup(Uint32)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setBandwidth
public ConstraintsBuilder setBandwidth(DecimalBandwidth value)
-
setClassType
public ConstraintsBuilder setClassType(org.opendaylight.yangtools.yang.common.Uint8 value)
-
setClassType
@Deprecated(forRemoval=true) public ConstraintsBuilder setClassType(Short value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setClassType(Uint8)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setDelay
public ConstraintsBuilder setDelay(Delay value)
-
setJitter
public ConstraintsBuilder setJitter(Delay value)
-
setLoss
public ConstraintsBuilder setLoss(Loss value)
-
setMetric
public ConstraintsBuilder setMetric(org.opendaylight.yangtools.yang.common.Uint32 value)
-
setMetric
@Deprecated(forRemoval=true) public ConstraintsBuilder setMetric(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setMetric(Uint32)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
setTeMetric
public ConstraintsBuilder setTeMetric(org.opendaylight.yangtools.yang.common.Uint32 value)
-
setTeMetric
@Deprecated(forRemoval=true) public ConstraintsBuilder setTeMetric(Long value)
Deprecated, for removal: This API element is subject to removal in a future version.Use {#link setTeMetric(Uint32)} instead.Utility migration setter.- Parameters:
value
- field value in legacy type- Returns:
- this builder
-
addAugmentation
public ConstraintsBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Constraints>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Constraints> augmentationValue)
-
removeAugmentation
public ConstraintsBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Constraints>> augmentationType)
-
build
public Constraints build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<Constraints>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<Constraints,IllegalArgumentException>
-
-