Class AclPortsByIpBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.acl.ports.lookup.AclPortsByIpBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<AclPortsByIp>
,org.opendaylight.yangtools.concepts.CheckedBuilder<AclPortsByIp,java.lang.IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class AclPortsByIpBuilder extends java.lang.Object implements org.opendaylight.yangtools.concepts.Builder<AclPortsByIp>
Class that buildsAclPortsByIpBuilder
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:
AclPortsByIpBuilder createTarget(int fooXyzzy, int barBaz) { return new AclPortsByIpBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of AclPortsByIpBuilder, 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:
AclPortsByIpBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description AclPortsByIpBuilder()
AclPortsByIpBuilder(AclPortsByIp base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AclPortsByIpBuilder
addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp> augmentationValue)
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp>>
E$$augmentation(java.lang.Class<E$$> augmentationType)
AclPortsByIp
build()
java.util.List<AclIpPrefixes>
getAclIpPrefixes()
java.lang.String
getAclName()
AclPortsByIpKey
key()
AclPortsByIpBuilder
removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp>> augmentationType)
AclPortsByIpBuilder
setAclIpPrefixes(java.util.List<AclIpPrefixes> values)
AclPortsByIpBuilder
setAclName(java.lang.String value)
AclPortsByIpBuilder
withKey(AclPortsByIpKey key)
-
-
-
Constructor Detail
-
AclPortsByIpBuilder
public AclPortsByIpBuilder()
-
AclPortsByIpBuilder
public AclPortsByIpBuilder(AclPortsByIp base)
-
-
Method Detail
-
key
public AclPortsByIpKey key()
-
getAclIpPrefixes
public java.util.List<AclIpPrefixes> getAclIpPrefixes()
-
getAclName
public java.lang.String getAclName()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp>> E$$ augmentation(java.lang.Class<E$$> augmentationType)
-
withKey
public AclPortsByIpBuilder withKey(AclPortsByIpKey key)
-
setAclIpPrefixes
public AclPortsByIpBuilder setAclIpPrefixes(java.util.List<AclIpPrefixes> values)
-
setAclName
public AclPortsByIpBuilder setAclName(java.lang.String value)
-
addAugmentation
public AclPortsByIpBuilder addAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp> augmentationValue)
-
removeAugmentation
public AclPortsByIpBuilder removeAugmentation(java.lang.Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<AclPortsByIp>> augmentationType)
-
build
public AclPortsByIp build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<AclPortsByIp>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<AclPortsByIp,java.lang.IllegalArgumentException>
-
-