Class FlowCapableNodeBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Builder<FlowCapableNode>
,org.opendaylight.yangtools.concepts.CheckedBuilder<FlowCapableNode,IllegalArgumentException>
,org.opendaylight.yangtools.concepts.Mutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>
public class FlowCapableNodeBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<FlowCapableNode>
Class that buildsFlowCapableNodeBuilder
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:
FlowCapableNodeBuilder createTarget(int fooXyzzy, int barBaz) { return new FlowCapableNodeBuilderBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of FlowCapableNodeBuilder, 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:
FlowCapableNodeBuilder
,Builder
-
-
Constructor Summary
Constructors Constructor Description FlowCapableNodeBuilder()
FlowCapableNodeBuilder(Desc arg)
FlowCapableNodeBuilder(FlowCapableNode base)
FlowCapableNodeBuilder(FlowNode arg)
FlowCapableNodeBuilder(IpAddressGrouping arg)
FlowCapableNodeBuilder(Meters arg)
FlowCapableNodeBuilder(PortNumberGrouping arg)
FlowCapableNodeBuilder(Tables arg)
FlowCapableNodeBuilder(Groups arg)
FlowCapableNodeBuilder(TableFeatures arg)
-
Method Summary
-
-
-
Constructor Detail
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder()
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(FlowNode arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Desc arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Tables arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(TableFeatures arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Groups arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Meters arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(IpAddressGrouping arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(PortNumberGrouping arg)
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(FlowCapableNode 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:- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.Desc
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.Meters
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.PortNumberGrouping
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.IpAddressGrouping
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.Tables
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures
- org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Groups
- Parameters:
arg
- grouping object- Throws:
IllegalArgumentException
- if given argument is none of valid types
-
getDescription
public String getDescription()
-
getHardware
public String getHardware()
-
getIpAddress
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress getIpAddress()
-
getManufacturer
public String getManufacturer()
-
getPortNumber
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber getPortNumber()
-
getSerialNumber
public String getSerialNumber()
-
getSoftware
public String getSoftware()
-
getStaleGroup
public List<StaleGroup> getStaleGroup()
-
getStaleMeter
public List<StaleMeter> getStaleMeter()
-
getSupportedActions
public SupportedActions getSupportedActions()
-
getSupportedInstructions
public SupportedInstructions getSupportedInstructions()
-
getSupportedMatchTypes
public SupportedMatchTypes getSupportedMatchTypes()
-
getSwitchFeatures
public SwitchFeatures getSwitchFeatures()
-
getTableFeatures
public List<TableFeatures> getTableFeatures()
-
setDescription
public FlowCapableNodeBuilder setDescription(String value)
-
setGroup
public FlowCapableNodeBuilder setGroup(List<Group> values)
-
setHardware
public FlowCapableNodeBuilder setHardware(String value)
-
setIpAddress
public FlowCapableNodeBuilder setIpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress value)
-
setManufacturer
public FlowCapableNodeBuilder setManufacturer(String value)
-
setMeter
public FlowCapableNodeBuilder setMeter(List<Meter> values)
-
setPortNumber
public FlowCapableNodeBuilder setPortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber value)
-
setSerialNumber
public FlowCapableNodeBuilder setSerialNumber(String value)
-
setSoftware
public FlowCapableNodeBuilder setSoftware(String value)
-
setStaleGroup
public FlowCapableNodeBuilder setStaleGroup(List<StaleGroup> values)
-
setStaleMeter
public FlowCapableNodeBuilder setStaleMeter(List<StaleMeter> values)
-
setSupportedActions
public FlowCapableNodeBuilder setSupportedActions(SupportedActions value)
-
setSupportedInstructions
public FlowCapableNodeBuilder setSupportedInstructions(SupportedInstructions value)
-
setSupportedMatchTypes
public FlowCapableNodeBuilder setSupportedMatchTypes(SupportedMatchTypes value)
-
setSwitchFeatures
public FlowCapableNodeBuilder setSwitchFeatures(SwitchFeatures value)
-
setTable
public FlowCapableNodeBuilder setTable(List<Table> values)
-
setTableFeatures
public FlowCapableNodeBuilder setTableFeatures(List<TableFeatures> values)
-
build
public FlowCapableNode build()
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.Builder<FlowCapableNode>
- Specified by:
build
in interfaceorg.opendaylight.yangtools.concepts.CheckedBuilder<FlowCapableNode,IllegalArgumentException>
-
-