Class NeighborBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbors.NeighborBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<Neighbor>
,org.opendaylight.yangtools.concepts.CheckedBuilder<Neighbor,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class NeighborBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Neighbor>
Class that buildsNeighborBuilder
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:
NeighborBuilder createTarget(int fooXyzzy, int barBaz) { return new NeighborBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of NeighborBuilder, 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:
NeighborBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description NeighborBuilder()
NeighborBuilder(Neighbor base)
NeighborBuilder(BgpGracefulRestart arg)
NeighborBuilder(BgpNeighborGroup arg)
NeighborBuilder(ApplyPolicyGroup arg)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NeighborBuilder
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor> augmentationValue)
Deprecated, for removal: This API element is subject to removal in a future version.Use eitheraddAugmentation(Augmentation)
orremoveAugmentation(Class)
instead.NeighborBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor>>
E$$augmentation(Class<E$$> augmentationType)
Neighbor
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.AddPaths
getAddPaths()
AfiSafis
getAfiSafis()
ApplyPolicy
getApplyPolicy()
AsPathOptions
getAsPathOptions()
Config
getConfig()
EbgpMultihop
getEbgpMultihop()
ErrorHandling
getErrorHandling()
GracefulRestart
getGracefulRestart()
LoggingOptions
getLoggingOptions()
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress
getNeighborAddress()
RouteReflector
getRouteReflector()
State
getState()
Timers
getTimers()
Transport
getTransport()
NeighborKey
key()
NeighborBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor>> augmentationType)
Remove an augmentation from this builder's product.NeighborBuilder
setAddPaths(AddPaths value)
NeighborBuilder
setAfiSafis(AfiSafis value)
NeighborBuilder
setApplyPolicy(ApplyPolicy value)
NeighborBuilder
setAsPathOptions(AsPathOptions value)
NeighborBuilder
setConfig(Config value)
NeighborBuilder
setEbgpMultihop(EbgpMultihop value)
NeighborBuilder
setErrorHandling(ErrorHandling value)
NeighborBuilder
setGracefulRestart(GracefulRestart value)
NeighborBuilder
setLoggingOptions(LoggingOptions value)
NeighborBuilder
setNeighborAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress value)
NeighborBuilder
setRouteReflector(RouteReflector value)
NeighborBuilder
setState(State value)
NeighborBuilder
setTimers(Timers value)
NeighborBuilder
setTransport(Transport value)
NeighborBuilder
withKey(NeighborKey key)
-
-
-
Constructor Detail
-
NeighborBuilder
public NeighborBuilder()
-
NeighborBuilder
public NeighborBuilder(BgpNeighborGroup arg)
-
NeighborBuilder
public NeighborBuilder(BgpGracefulRestart arg)
-
NeighborBuilder
public NeighborBuilder(ApplyPolicyGroup arg)
-
NeighborBuilder
public NeighborBuilder(Neighbor 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.http.openconfig.net.yang.bgp.rev151009.BgpGracefulRestart
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.ApplyPolicyGroup
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.BgpNeighborGroup
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
key
public NeighborKey key()
-
getAddPaths
public AddPaths getAddPaths()
-
getAfiSafis
public AfiSafis getAfiSafis()
-
getApplyPolicy
public ApplyPolicy getApplyPolicy()
-
getAsPathOptions
public AsPathOptions getAsPathOptions()
-
getConfig
public Config getConfig()
-
getEbgpMultihop
public EbgpMultihop getEbgpMultihop()
-
getErrorHandling
public ErrorHandling getErrorHandling()
-
getGracefulRestart
public GracefulRestart getGracefulRestart()
-
getLoggingOptions
public LoggingOptions getLoggingOptions()
-
getNeighborAddress
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress getNeighborAddress()
-
getRouteReflector
public RouteReflector getRouteReflector()
-
getState
public State getState()
-
getTimers
public Timers getTimers()
-
getTransport
public Transport getTransport()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor>> E$$ augmentation(Class<E$$> augmentationType)
-
withKey
public NeighborBuilder withKey(NeighborKey key)
-
setAddPaths
public NeighborBuilder setAddPaths(AddPaths value)
-
setAfiSafis
public NeighborBuilder setAfiSafis(AfiSafis value)
-
setApplyPolicy
public NeighborBuilder setApplyPolicy(ApplyPolicy value)
-
setAsPathOptions
public NeighborBuilder setAsPathOptions(AsPathOptions value)
-
setConfig
public NeighborBuilder setConfig(Config value)
-
setEbgpMultihop
public NeighborBuilder setEbgpMultihop(EbgpMultihop value)
-
setErrorHandling
public NeighborBuilder setErrorHandling(ErrorHandling value)
-
setGracefulRestart
public NeighborBuilder setGracefulRestart(GracefulRestart value)
-
setLoggingOptions
public NeighborBuilder setLoggingOptions(LoggingOptions value)
-
setNeighborAddress
public NeighborBuilder setNeighborAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress value)
-
setRouteReflector
public NeighborBuilder setRouteReflector(RouteReflector value)
-
setState
public NeighborBuilder setState(State value)
-
setTimers
public NeighborBuilder setTimers(Timers value)
-
setTransport
public NeighborBuilder setTransport(Transport value)
-
addAugmentation
public NeighborBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor> augmentation)
Add an augmentation to this builder's product.- Parameters:
augmentation
- augmentation to be added- Returns:
- this builder
- Throws:
NullPointerException
- ifaugmentation
is null
-
addAugmentation
@Deprecated(forRemoval=true) public NeighborBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor> augmentationValue)
Deprecated, for removal: This API element is subject to removal in a future version.Use eitheraddAugmentation(Augmentation)
orremoveAugmentation(Class)
instead.Add or remove an augmentation to this builder's product.- Parameters:
augmentationType
- augmentation type to be added or removedaugmentationValue
- augmentation value, null if the augmentation type should be removed- Returns:
- this builder
-
removeAugmentation
public NeighborBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Neighbor>> 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 Neighbor build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<Neighbor>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<Neighbor,IllegalArgumentException>
-
-