Class BgpConditionsBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.conditions.BgpConditionsBuilder
Class that builds
BgpConditions
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:
BgpConditions createBgpConditions(int fooXyzzy, int barBaz) {
return new BgpConditionsBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of BgpConditions, 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:
-
Constructor Summary
ConstructorDescriptionConstruct an empty builder.Construct a new builder initialized from specifiedBgpAttributeConditions
.Construct a new builder initialized from specifiedBgpMatchConditions
.Construct a builder initialized with state from specifiedBgpConditions
. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation
(org.opendaylight.yangtools.binding.Augmentation<BgpConditions> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.binding.Augmentation<BgpConditions>>
E$$augmentation
(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.@NonNull BgpConditions
build()
A newBgpConditions
instance.static @NonNull BgpConditions
empty()
Get empty instance of BgpConditions.void
fieldsFrom
(org.opendaylight.yangtools.binding.Grouping arg) Set fields from given grouping argument.Return current value associated with the property corresponding toBgpAttributeConditions.getAfiSafiIn()
.Return current value associated with the property corresponding toBgpAttributeConditions.getAsPathLength()
.Return current value associated with the property corresponding toBgpAttributeConditions.getCommunityCount()
.org.opendaylight.yangtools.yang.common.Uint32
Return current value associated with the property corresponding toBgpAttributeConditions.getLocalPrefEq()
.Return current value associated with the property corresponding toBgpMatchConditions.getMatchAsPathSet()
.Return current value associated with the property corresponding toBgpMatchConditions.getMatchCommunitySet()
.Return current value associated with the property corresponding toBgpMatchConditions.getMatchExtCommunitySet()
.org.opendaylight.yangtools.yang.common.Uint32
getMedEq()
Return current value associated with the property corresponding toBgpAttributeConditions.getMedEq()
.Set
<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress> Return current value associated with the property corresponding toBgpAttributeConditions.getNextHopIn()
.Return current value associated with the property corresponding toBgpAttributeConditions.getOriginEq()
.Return current value associated with the property corresponding toBgpAttributeConditions.getRouteType()
.removeAugmentation
(Class<? extends org.opendaylight.yangtools.binding.Augmentation<BgpConditions>> augmentationType) Remove an augmentation from this builder's product.setAfiSafiIn
(Set<AfiSafiType> values) Set the property corresponding toBgpAttributeConditions.getAfiSafiIn()
to the specified value.setAsPathLength
(AsPathLength value) Set the property corresponding toBgpAttributeConditions.getAsPathLength()
to the specified value.setCommunityCount
(CommunityCount value) Set the property corresponding toBgpAttributeConditions.getCommunityCount()
to the specified value.setLocalPrefEq
(org.opendaylight.yangtools.yang.common.Uint32 value) Set the property corresponding toBgpAttributeConditions.getLocalPrefEq()
to the specified value.setMatchAsPathSet
(MatchAsPathSet value) Set the property corresponding toBgpMatchConditions.getMatchAsPathSet()
to the specified value.Set the property corresponding toBgpMatchConditions.getMatchCommunitySet()
to the specified value.Set the property corresponding toBgpMatchConditions.getMatchExtCommunitySet()
to the specified value.setMedEq
(org.opendaylight.yangtools.yang.common.Uint32 value) Set the property corresponding toBgpAttributeConditions.getMedEq()
to the specified value.setNextHopIn
(Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress> values) Set the property corresponding toBgpAttributeConditions.getNextHopIn()
to the specified value.setOriginEq
(BgpOriginAttrType value) Set the property corresponding toBgpAttributeConditions.getOriginEq()
to the specified value.Set the property corresponding toBgpAttributeConditions.getRouteType()
to the specified value.
-
Constructor Details
-
BgpConditionsBuilder
public BgpConditionsBuilder()Construct an empty builder. -
BgpConditionsBuilder
Construct a new builder initialized from specifiedBgpMatchConditions
.- Parameters:
arg
- BgpMatchConditions from which the builder should be initialized
-
BgpConditionsBuilder
Construct a new builder initialized from specifiedBgpAttributeConditions
.- Parameters:
arg
- BgpAttributeConditions from which the builder should be initialized
-
BgpConditionsBuilder
Construct a builder initialized with state from specifiedBgpConditions
.- Parameters:
base
- BgpConditions from which the builder should be initialized
-
-
Method Details
-
fieldsFrom
public void fieldsFrom(org.opendaylight.yangtools.binding.Grouping 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
-
empty
Get empty instance of BgpConditions.- Returns:
- An empty
BgpConditions
-
getAfiSafiIn
Return current value associated with the property corresponding toBgpAttributeConditions.getAfiSafiIn()
.- Returns:
- current value
-
getAsPathLength
Return current value associated with the property corresponding toBgpAttributeConditions.getAsPathLength()
.- Returns:
- current value
-
getCommunityCount
Return current value associated with the property corresponding toBgpAttributeConditions.getCommunityCount()
.- Returns:
- current value
-
getLocalPrefEq
public org.opendaylight.yangtools.yang.common.Uint32 getLocalPrefEq()Return current value associated with the property corresponding toBgpAttributeConditions.getLocalPrefEq()
.- Returns:
- current value
-
getMatchAsPathSet
Return current value associated with the property corresponding toBgpMatchConditions.getMatchAsPathSet()
.- Returns:
- current value
-
getMatchCommunitySet
Return current value associated with the property corresponding toBgpMatchConditions.getMatchCommunitySet()
.- Returns:
- current value
-
getMatchExtCommunitySet
Return current value associated with the property corresponding toBgpMatchConditions.getMatchExtCommunitySet()
.- Returns:
- current value
-
getMedEq
public org.opendaylight.yangtools.yang.common.Uint32 getMedEq()Return current value associated with the property corresponding toBgpAttributeConditions.getMedEq()
.- Returns:
- current value
-
getNextHopIn
public Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress> getNextHopIn()Return current value associated with the property corresponding toBgpAttributeConditions.getNextHopIn()
.- Returns:
- current value
-
getOriginEq
Return current value associated with the property corresponding toBgpAttributeConditions.getOriginEq()
.- Returns:
- current value
-
getRouteType
Return current value associated with the property corresponding toBgpAttributeConditions.getRouteType()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.binding.Augmentation<BgpConditions>> 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
null
if not present - Throws:
NullPointerException
- ifaugmentType
isnull
-
setAfiSafiIn
Set the property corresponding toBgpAttributeConditions.getAfiSafiIn()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setAsPathLength
Set the property corresponding toBgpAttributeConditions.getAsPathLength()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setCommunityCount
Set the property corresponding toBgpAttributeConditions.getCommunityCount()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLocalPrefEq
Set the property corresponding toBgpAttributeConditions.getLocalPrefEq()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMatchAsPathSet
Set the property corresponding toBgpMatchConditions.getMatchAsPathSet()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMatchCommunitySet
Set the property corresponding toBgpMatchConditions.getMatchCommunitySet()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMatchExtCommunitySet
Set the property corresponding toBgpMatchConditions.getMatchExtCommunitySet()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMedEq
Set the property corresponding toBgpAttributeConditions.getMedEq()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setNextHopIn
public BgpConditionsBuilder setNextHopIn(Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress> values) Set the property corresponding toBgpAttributeConditions.getNextHopIn()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setOriginEq
Set the property corresponding toBgpAttributeConditions.getOriginEq()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRouteType
Set the property corresponding toBgpAttributeConditions.getRouteType()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public BgpConditionsBuilder addAugmentation(org.opendaylight.yangtools.binding.Augmentation<BgpConditions> augmentation) Add an augmentation to this builder's product.- Parameters:
augmentation
- augmentation to be added- Returns:
- this builder
- Throws:
NullPointerException
- ifaugmentation
is null
-
removeAugmentation
public BgpConditionsBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.binding.Augmentation<BgpConditions>> 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
A newBgpConditions
instance.- Returns:
- A new
BgpConditions
instance.
-