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
-
@Generated("mdsal-binding-generator") public class BgpConditionsBuilder extends Object
Class that buildsBgpConditions
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:
BgpConditions
- 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 BgpConditionsBuilder()
Construct an empty builder.BgpConditionsBuilder(BgpAttributeConditions arg)
Construct a new builder initialized from specifiedBgpAttributeConditions
.BgpConditionsBuilder(BgpMatchConditions arg)
Construct a new builder initialized from specifiedBgpMatchConditions
.BgpConditionsBuilder(BgpConditions base)
Construct a builder initialized with state from specifiedBgpConditions
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BgpConditionsBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<BgpConditions> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.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.void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.Set<Class<? extends AfiSafiType>>
getAfiSafiIn()
Return current value associated with the property corresponding toBgpAttributeConditions.getAfiSafiIn()
.AsPathLength
getAsPathLength()
Return current value associated with the property corresponding toBgpAttributeConditions.getAsPathLength()
.CommunityCount
getCommunityCount()
Return current value associated with the property corresponding toBgpAttributeConditions.getCommunityCount()
.org.opendaylight.yangtools.yang.common.Uint32
getLocalPrefEq()
Return current value associated with the property corresponding toBgpAttributeConditions.getLocalPrefEq()
.MatchAsPathSet
getMatchAsPathSet()
Return current value associated with the property corresponding toBgpMatchConditions.getMatchAsPathSet()
.MatchCommunitySet
getMatchCommunitySet()
Return current value associated with the property corresponding toBgpMatchConditions.getMatchCommunitySet()
.MatchExtCommunitySet
getMatchExtCommunitySet()
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>
getNextHopIn()
Return current value associated with the property corresponding toBgpAttributeConditions.getNextHopIn()
.BgpOriginAttrType
getOriginEq()
Return current value associated with the property corresponding toBgpAttributeConditions.getOriginEq()
.BgpAttributeConditions.RouteType
getRouteType()
Return current value associated with the property corresponding toBgpAttributeConditions.getRouteType()
.BgpConditionsBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<BgpConditions>> augmentationType)
Remove an augmentation from this builder's product.BgpConditionsBuilder
setAfiSafiIn(Set<Class<? extends AfiSafiType>> values)
Set the property corresponding toBgpAttributeConditions.getAfiSafiIn()
to the specified value.BgpConditionsBuilder
setAsPathLength(AsPathLength value)
Set the property corresponding toBgpAttributeConditions.getAsPathLength()
to the specified value.BgpConditionsBuilder
setCommunityCount(CommunityCount value)
Set the property corresponding toBgpAttributeConditions.getCommunityCount()
to the specified value.BgpConditionsBuilder
setLocalPrefEq(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toBgpAttributeConditions.getLocalPrefEq()
to the specified value.BgpConditionsBuilder
setMatchAsPathSet(MatchAsPathSet value)
Set the property corresponding toBgpMatchConditions.getMatchAsPathSet()
to the specified value.BgpConditionsBuilder
setMatchCommunitySet(MatchCommunitySet value)
Set the property corresponding toBgpMatchConditions.getMatchCommunitySet()
to the specified value.BgpConditionsBuilder
setMatchExtCommunitySet(MatchExtCommunitySet value)
Set the property corresponding toBgpMatchConditions.getMatchExtCommunitySet()
to the specified value.BgpConditionsBuilder
setMedEq(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toBgpAttributeConditions.getMedEq()
to the specified value.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.BgpConditionsBuilder
setOriginEq(BgpOriginAttrType value)
Set the property corresponding toBgpAttributeConditions.getOriginEq()
to the specified value.BgpConditionsBuilder
setRouteType(BgpAttributeConditions.RouteType value)
Set the property corresponding toBgpAttributeConditions.getRouteType()
to the specified value.
-
-
-
Constructor Detail
-
BgpConditionsBuilder
public BgpConditionsBuilder()
Construct an empty builder.
-
BgpConditionsBuilder
public BgpConditionsBuilder(BgpMatchConditions arg)
Construct a new builder initialized from specifiedBgpMatchConditions
.- Parameters:
arg
- BgpMatchConditions from which the builder should be initialized
-
BgpConditionsBuilder
public BgpConditionsBuilder(BgpAttributeConditions arg)
Construct a new builder initialized from specifiedBgpAttributeConditions
.- Parameters:
arg
- BgpAttributeConditions from which the builder should be initialized
-
BgpConditionsBuilder
public BgpConditionsBuilder(BgpConditions base)
Construct a builder initialized with state from specifiedBgpConditions
.- Parameters:
base
- BgpConditions 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
-
getAfiSafiIn
public Set<Class<? extends AfiSafiType>> getAfiSafiIn()
Return current value associated with the property corresponding toBgpAttributeConditions.getAfiSafiIn()
.- Returns:
- current value
-
getAsPathLength
public AsPathLength getAsPathLength()
Return current value associated with the property corresponding toBgpAttributeConditions.getAsPathLength()
.- Returns:
- current value
-
getCommunityCount
public CommunityCount 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
public MatchAsPathSet getMatchAsPathSet()
Return current value associated with the property corresponding toBgpMatchConditions.getMatchAsPathSet()
.- Returns:
- current value
-
getMatchCommunitySet
public MatchCommunitySet getMatchCommunitySet()
Return current value associated with the property corresponding toBgpMatchConditions.getMatchCommunitySet()
.- Returns:
- current value
-
getMatchExtCommunitySet
public MatchExtCommunitySet 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
public BgpOriginAttrType getOriginEq()
Return current value associated with the property corresponding toBgpAttributeConditions.getOriginEq()
.- Returns:
- current value
-
getRouteType
public BgpAttributeConditions.RouteType getRouteType()
Return current value associated with the property corresponding toBgpAttributeConditions.getRouteType()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.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
public BgpConditionsBuilder setAfiSafiIn(Set<Class<? extends AfiSafiType>> values)
Set the property corresponding toBgpAttributeConditions.getAfiSafiIn()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setAsPathLength
public BgpConditionsBuilder setAsPathLength(AsPathLength value)
Set the property corresponding toBgpAttributeConditions.getAsPathLength()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setCommunityCount
public BgpConditionsBuilder setCommunityCount(CommunityCount value)
Set the property corresponding toBgpAttributeConditions.getCommunityCount()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setLocalPrefEq
public BgpConditionsBuilder setLocalPrefEq(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toBgpAttributeConditions.getLocalPrefEq()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMatchAsPathSet
public BgpConditionsBuilder setMatchAsPathSet(MatchAsPathSet value)
Set the property corresponding toBgpMatchConditions.getMatchAsPathSet()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMatchCommunitySet
public BgpConditionsBuilder setMatchCommunitySet(MatchCommunitySet value)
Set the property corresponding toBgpMatchConditions.getMatchCommunitySet()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMatchExtCommunitySet
public BgpConditionsBuilder setMatchExtCommunitySet(MatchExtCommunitySet value)
Set the property corresponding toBgpMatchConditions.getMatchExtCommunitySet()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMedEq
public BgpConditionsBuilder setMedEq(org.opendaylight.yangtools.yang.common.Uint32 value)
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
public BgpConditionsBuilder setOriginEq(BgpOriginAttrType value)
Set the property corresponding toBgpAttributeConditions.getOriginEq()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRouteType
public BgpConditionsBuilder setRouteType(BgpAttributeConditions.RouteType value)
Set the property corresponding toBgpAttributeConditions.getRouteType()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public BgpConditionsBuilder addAugmentation(org.opendaylight.yangtools.yang.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.yang.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
public @NonNull BgpConditions build()
A newBgpConditions
instance.- Returns:
- A new
BgpConditions
instance.
-
-