Class ClearNeighborsRequestBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.sonic.gnoi.yang.rev210614.clearneighbors.input.ClearNeighborsRequestBuilder
-
@Generated("mdsal-binding-generator") public class ClearNeighborsRequestBuilder extends Object
Class that buildsClearNeighborsRequestinstances. 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:
ClearNeighborsRequest createClearNeighborsRequest(int fooXyzzy, int barBaz) { return new ClearNeighborsRequestBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }This pattern is supported by the immutable nature of ClearNeighborsRequest, 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 opportunities, 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:
ClearNeighborsRequest
- 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
-
-
Constructor Summary
Constructors Constructor Description ClearNeighborsRequestBuilder()Construct an empty builder.ClearNeighborsRequestBuilder(ClearNeighborsRequest base)Construct a builder initialized with state from specifiedClearNeighborsRequest.ClearNeighborsRequestBuilder(ClearNeighborsRequest arg)Construct a new builder initialized from specifiedClearNeighborsRequest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClearNeighborsRequestBuilderaddAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<ClearNeighborsRequest> augmentation)Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ClearNeighborsRequest>>
E$$augmentation(Class<E$$> augmentationType)Return the specified augmentation, if it is present in this builder.@NonNull ClearNeighborsRequestbuild()A newClearNeighborsRequestinstance.voidfieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)Set fields from given grouping argument.StringgetFamily()Return current value associated with the property corresponding toClearNeighborsRequest.getFamily().BooleangetForce()Return current value associated with the property corresponding toClearNeighborsRequest.getForce().StringgetIfname()Return current value associated with the property corresponding toClearNeighborsRequest.getIfname().StringgetIp()Return current value associated with the property corresponding toClearNeighborsRequest.getIp().ClearNeighborsRequestBuilderremoveAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ClearNeighborsRequest>> augmentationType)Remove an augmentation from this builder's product.ClearNeighborsRequestBuildersetFamily(String value)Set the property corresponding toClearNeighborsRequest.getFamily()to the specified value.ClearNeighborsRequestBuildersetForce(Boolean value)Set the property corresponding toClearNeighborsRequest.getForce()to the specified value.ClearNeighborsRequestBuildersetIfname(String value)Set the property corresponding toClearNeighborsRequest.getIfname()to the specified value.ClearNeighborsRequestBuildersetIp(String value)Set the property corresponding toClearNeighborsRequest.getIp()to the specified value.
-
-
-
Constructor Detail
-
ClearNeighborsRequestBuilder
public ClearNeighborsRequestBuilder()
Construct an empty builder.
-
ClearNeighborsRequestBuilder
public ClearNeighborsRequestBuilder(ClearNeighborsRequest arg)
Construct a new builder initialized from specifiedClearNeighborsRequest.- Parameters:
arg- org.opendaylight.yang.gen.v1.sonic.gnoi.yang.rev210614.ClearNeighborsRequest from which the builder should be initialized
-
ClearNeighborsRequestBuilder
public ClearNeighborsRequestBuilder(ClearNeighborsRequest base)
Construct a builder initialized with state from specifiedClearNeighborsRequest.- Parameters:
base- ClearNeighborsRequest from which the builder should be initialized
-
-
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:- Parameters:
arg- grouping object- Throws:
IllegalArgumentException- if given argument is none of valid types or has property with incompatible value
-
getFamily
public String getFamily()
Return current value associated with the property corresponding toClearNeighborsRequest.getFamily().- Returns:
- current value
-
getForce
public Boolean getForce()
Return current value associated with the property corresponding toClearNeighborsRequest.getForce().- Returns:
- current value
-
getIfname
public String getIfname()
Return current value associated with the property corresponding toClearNeighborsRequest.getIfname().- Returns:
- current value
-
getIp
public String getIp()
Return current value associated with the property corresponding toClearNeighborsRequest.getIp().- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ClearNeighborsRequest>> E$$ augmentation(Class<E$$> augmentationType)
Return the specified augmentation, if it is present in this builder.- Type Parameters:
E$$- augmentation type- Parameters:
augmentationType- augmentation type class- Returns:
- Augmentation object from this builder, or
nullif not present - Throws:
NullPointerException- ifaugmentTypeisnull
-
setFamily
public ClearNeighborsRequestBuilder setFamily(String value)
Set the property corresponding toClearNeighborsRequest.getFamily()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setForce
public ClearNeighborsRequestBuilder setForce(Boolean value)
Set the property corresponding toClearNeighborsRequest.getForce()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setIfname
public ClearNeighborsRequestBuilder setIfname(String value)
Set the property corresponding toClearNeighborsRequest.getIfname()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setIp
public ClearNeighborsRequestBuilder setIp(String value)
Set the property corresponding toClearNeighborsRequest.getIp()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
addAugmentation
public ClearNeighborsRequestBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<ClearNeighborsRequest> augmentation)
Add an augmentation to this builder's product.- Parameters:
augmentation- augmentation to be added- Returns:
- this builder
- Throws:
NullPointerException- ifaugmentationis null
-
removeAugmentation
public ClearNeighborsRequestBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ClearNeighborsRequest>> augmentationType)
Remove an augmentation from this builder's product. If this builder does not track such an augmentation type, this method does nothing.- Parameters:
augmentationType- augmentation type to be removed- Returns:
- this builder
-
build
public @NonNull ClearNeighborsRequest build()
A newClearNeighborsRequestinstance.- Returns:
- A new
ClearNeighborsRequestinstance.
-
-