Package org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match
Class ArpMatchBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<ArpMatch>
,org.opendaylight.yangtools.concepts.CheckedBuilder<ArpMatch,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
@Generated("mdsal-binding-generator") public class ArpMatchBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<ArpMatch>
Class that buildsArpMatch
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:
ArpMatch createArpMatch(int fooXyzzy, int barBaz) { return new ArpMatchBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of ArpMatch, 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:
ArpMatch
,Builder
-
-
Constructor Summary
Constructors Constructor Description ArpMatchBuilder()
ArpMatchBuilder(ArpMatchFields arg)
ArpMatchBuilder(ArpMatch base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArpMatchBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<ArpMatch> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ArpMatch>>
E$$augmentation(Class<E$$> augmentationType)
ArpMatch
build()
void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.org.opendaylight.yangtools.yang.common.Uint16
getArpOp()
ArpSourceHardwareAddress
getArpSourceHardwareAddress()
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix
getArpSourceTransportAddress()
ArpTargetHardwareAddress
getArpTargetHardwareAddress()
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix
getArpTargetTransportAddress()
ArpMatchBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ArpMatch>> augmentationType)
Remove an augmentation from this builder's product.ArpMatchBuilder
setArpOp(org.opendaylight.yangtools.yang.common.Uint16 value)
ArpMatchBuilder
setArpSourceHardwareAddress(ArpSourceHardwareAddress value)
ArpMatchBuilder
setArpSourceTransportAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix value)
ArpMatchBuilder
setArpTargetHardwareAddress(ArpTargetHardwareAddress value)
ArpMatchBuilder
setArpTargetTransportAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix value)
-
-
-
Constructor Detail
-
ArpMatchBuilder
public ArpMatchBuilder()
-
ArpMatchBuilder
public ArpMatchBuilder(ArpMatchFields arg)
-
ArpMatchBuilder
public ArpMatchBuilder(ArpMatch 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:- ArpMatchFields
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types or has property with incompatible value
-
getArpOp
public org.opendaylight.yangtools.yang.common.Uint16 getArpOp()
-
getArpSourceHardwareAddress
public ArpSourceHardwareAddress getArpSourceHardwareAddress()
-
getArpSourceTransportAddress
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix getArpSourceTransportAddress()
-
getArpTargetHardwareAddress
public ArpTargetHardwareAddress getArpTargetHardwareAddress()
-
getArpTargetTransportAddress
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix getArpTargetTransportAddress()
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<ArpMatch>> E$$ augmentation(Class<E$$> augmentationType)
-
setArpOp
public ArpMatchBuilder setArpOp(org.opendaylight.yangtools.yang.common.Uint16 value)
-
setArpSourceHardwareAddress
public ArpMatchBuilder setArpSourceHardwareAddress(ArpSourceHardwareAddress value)
-
setArpSourceTransportAddress
public ArpMatchBuilder setArpSourceTransportAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix value)
-
setArpTargetHardwareAddress
public ArpMatchBuilder setArpTargetHardwareAddress(ArpTargetHardwareAddress value)
-
setArpTargetTransportAddress
public ArpMatchBuilder setArpTargetTransportAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix value)
-
addAugmentation
public ArpMatchBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<ArpMatch> 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 ArpMatchBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<ArpMatch>> 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 ArpMatch build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<ArpMatch>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<ArpMatch,IllegalArgumentException>
-
-