Class AclsBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.AclsBuilder
-
@Generated("mdsal-binding-generator") public class AclsBuilder extends Object
Class that buildsAcls
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:
Acls createAcls(int fooXyzzy, int barBaz) { return new AclsBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of Acls, 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:
Acls
- 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 AclsBuilder()
Construct an empty builder.AclsBuilder(Acls base)
Construct a builder initialized with state from specifiedAcls
.AclsBuilder(HwvtepAclAttributes arg)
Construct a new builder initialized from specifiedHwvtepAclAttributes
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AclsBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<Acls> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Acls>>
E$$augmentation(Class<E$$> augmentationType)
Return the specified augmentation, if it is present in this builder.@NonNull Acls
build()
A newAcls
instance.void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.List<AclEntries>
getAclEntries()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclEntries()
.Map<AclFaultStatusKey,AclFaultStatus>
getAclFaultStatus()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclFaultStatus()
.String
getAclName()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclName()
.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid
getAclUuid()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclUuid()
.AclsKey
key()
Return current value associated with the property corresponding toAcls.key()
.AclsBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Acls>> augmentationType)
Remove an augmentation from this builder's product.AclsBuilder
setAclEntries(List<AclEntries> values)
Set the property corresponding toHwvtepAclAttributes.getAclEntries()
to the specified value.AclsBuilder
setAclFaultStatus(Map<AclFaultStatusKey,AclFaultStatus> values)
Set the property corresponding toHwvtepAclAttributes.getAclFaultStatus()
to the specified value.AclsBuilder
setAclName(String value)
Set the property corresponding toHwvtepAclAttributes.getAclName()
to the specified value.AclsBuilder
setAclUuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid value)
Set the property corresponding toHwvtepAclAttributes.getAclUuid()
to the specified value.AclsBuilder
withKey(AclsKey key)
-
-
-
Constructor Detail
-
AclsBuilder
public AclsBuilder()
Construct an empty builder.
-
AclsBuilder
public AclsBuilder(HwvtepAclAttributes arg)
Construct a new builder initialized from specifiedHwvtepAclAttributes
.- Parameters:
arg
- HwvtepAclAttributes 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
-
key
public AclsKey key()
Return current value associated with the property corresponding toAcls.key()
.- Returns:
- current value
-
getAclEntries
public List<AclEntries> getAclEntries()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclEntries()
.- Returns:
- current value
-
getAclFaultStatus
public Map<AclFaultStatusKey,AclFaultStatus> getAclFaultStatus()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclFaultStatus()
.- Returns:
- current value
-
getAclName
public String getAclName()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclName()
.- Returns:
- current value
-
getAclUuid
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid getAclUuid()
Return current value associated with the property corresponding toHwvtepAclAttributes.getAclUuid()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Acls>> 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
-
withKey
public AclsBuilder withKey(AclsKey key)
-
setAclEntries
public AclsBuilder setAclEntries(List<AclEntries> values)
Set the property corresponding toHwvtepAclAttributes.getAclEntries()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setAclFaultStatus
public AclsBuilder setAclFaultStatus(Map<AclFaultStatusKey,AclFaultStatus> values)
Set the property corresponding toHwvtepAclAttributes.getAclFaultStatus()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setAclName
public AclsBuilder setAclName(String value)
Set the property corresponding toHwvtepAclAttributes.getAclName()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setAclUuid
public AclsBuilder setAclUuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid value)
Set the property corresponding toHwvtepAclAttributes.getAclUuid()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public AclsBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<Acls> 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 AclsBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Acls>> 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
-
-