Class FlowCapableNodeBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder
Class that builds
FlowCapableNode
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:
FlowCapableNode createFlowCapableNode(int fooXyzzy, int barBaz) {
return new FlowCapableNodeBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of FlowCapableNode, 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:
-
Constructor Summary
ConstructorDescriptionConstruct an empty builder.Construct a new builder initialized from specifiedDesc
.Construct a builder initialized with state from specifiedFlowCapableNode
.Construct a new builder initialized from specifiedFlowNode
.Construct a new builder initialized from specifiedIpAddressGrouping
.Construct a new builder initialized from specifiedMeters
.Construct a new builder initialized from specifiedPortNumberGrouping
.Construct a new builder initialized from specifiedTables
.Construct a new builder initialized from specifiedGroups
.Construct a new builder initialized from specifiedTableFeatures
. -
Method Summary
Modifier and TypeMethodDescription@NonNull FlowCapableNode
build()
A newFlowCapableNode
instance.void
fieldsFrom
(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.Return current value associated with the property corresponding toDesc.getDescription()
.getGroup()
Return current value associated with the property corresponding toGroups.getGroup()
.Return current value associated with the property corresponding toDesc.getHardware()
.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress
Return current value associated with the property corresponding toIpAddressGrouping.getIpAddress()
.Return current value associated with the property corresponding toDesc.getManufacturer()
.getMeter()
Return current value associated with the property corresponding toMeters.getMeter()
.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber
Return current value associated with the property corresponding toPortNumberGrouping.getPortNumber()
.Return current value associated with the property corresponding toDesc.getSerialNumber()
.Return current value associated with the property corresponding toDesc.getSoftware()
.Return current value associated with the property corresponding toGroups.getStaleGroup()
.Return current value associated with the property corresponding toMeters.getStaleMeter()
.Return current value associated with the property corresponding toFlowNode.getSupportedActions()
.Return current value associated with the property corresponding toFlowNode.getSupportedInstructions()
.Return current value associated with the property corresponding toFlowNode.getSupportedMatchTypes()
.Return current value associated with the property corresponding toFlowNode.getSwitchFeatures()
.getTable()
Return current value associated with the property corresponding toTables.getTable()
.Return current value associated with the property corresponding toTableFeatures.getTableFeatures()
.setDescription
(String value) Set the property corresponding toDesc.getDescription()
to the specified value.Set the property corresponding toGroups.getGroup()
to the specified value.setHardware
(String value) Set the property corresponding toDesc.getHardware()
to the specified value.setIpAddress
(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress value) Set the property corresponding toIpAddressGrouping.getIpAddress()
to the specified value.setManufacturer
(String value) Set the property corresponding toDesc.getManufacturer()
to the specified value.Set the property corresponding toMeters.getMeter()
to the specified value.setPortNumber
(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber value) Set the property corresponding toPortNumberGrouping.getPortNumber()
to the specified value.setSerialNumber
(String value) Set the property corresponding toDesc.getSerialNumber()
to the specified value.setSoftware
(String value) Set the property corresponding toDesc.getSoftware()
to the specified value.setStaleGroup
(Map<StaleGroupKey, StaleGroup> values) Set the property corresponding toGroups.getStaleGroup()
to the specified value.setStaleMeter
(Map<StaleMeterKey, StaleMeter> values) Set the property corresponding toMeters.getStaleMeter()
to the specified value.Set the property corresponding toFlowNode.getSupportedActions()
to the specified value.Set the property corresponding toFlowNode.getSupportedInstructions()
to the specified value.Set the property corresponding toFlowNode.getSupportedMatchTypes()
to the specified value.setSwitchFeatures
(SwitchFeatures value) Set the property corresponding toFlowNode.getSwitchFeatures()
to the specified value.Set the property corresponding toTables.getTable()
to the specified value.setTableFeatures
(Map<TableFeaturesKey, TableFeatures> values) Set the property corresponding toTableFeatures.getTableFeatures()
to the specified value.
-
Constructor Details
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder()Construct an empty builder. -
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedFlowNode
.- Parameters:
arg
- FlowNode from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedDesc
.- Parameters:
arg
- Desc from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedTables
.- Parameters:
arg
- Tables from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedTableFeatures
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedGroups
.- Parameters:
arg
- Groups from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedMeters
.- Parameters:
arg
- Meters from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedIpAddressGrouping
.- Parameters:
arg
- IpAddressGrouping from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a new builder initialized from specifiedPortNumberGrouping
.- Parameters:
arg
- PortNumberGrouping from which the builder should be initialized
-
FlowCapableNodeBuilder
Construct a builder initialized with state from specifiedFlowCapableNode
.- Parameters:
base
- FlowCapableNode from which the builder should be initialized
-
-
Method Details
-
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
-
getDescription
Return current value associated with the property corresponding toDesc.getDescription()
.- Returns:
- current value
-
getGroup
Return current value associated with the property corresponding toGroups.getGroup()
.- Returns:
- current value
-
getHardware
Return current value associated with the property corresponding toDesc.getHardware()
.- Returns:
- current value
-
getIpAddress
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress getIpAddress()Return current value associated with the property corresponding toIpAddressGrouping.getIpAddress()
.- Returns:
- current value
-
getManufacturer
Return current value associated with the property corresponding toDesc.getManufacturer()
.- Returns:
- current value
-
getMeter
Return current value associated with the property corresponding toMeters.getMeter()
.- Returns:
- current value
-
getPortNumber
public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber getPortNumber()Return current value associated with the property corresponding toPortNumberGrouping.getPortNumber()
.- Returns:
- current value
-
getSerialNumber
Return current value associated with the property corresponding toDesc.getSerialNumber()
.- Returns:
- current value
-
getSoftware
Return current value associated with the property corresponding toDesc.getSoftware()
.- Returns:
- current value
-
getStaleGroup
Return current value associated with the property corresponding toGroups.getStaleGroup()
.- Returns:
- current value
-
getStaleMeter
Return current value associated with the property corresponding toMeters.getStaleMeter()
.- Returns:
- current value
-
getSupportedActions
Return current value associated with the property corresponding toFlowNode.getSupportedActions()
.- Returns:
- current value
-
getSupportedInstructions
Return current value associated with the property corresponding toFlowNode.getSupportedInstructions()
.- Returns:
- current value
-
getSupportedMatchTypes
Return current value associated with the property corresponding toFlowNode.getSupportedMatchTypes()
.- Returns:
- current value
-
getSwitchFeatures
Return current value associated with the property corresponding toFlowNode.getSwitchFeatures()
.- Returns:
- current value
-
getTable
Return current value associated with the property corresponding toTables.getTable()
.- Returns:
- current value
-
getTableFeatures
Return current value associated with the property corresponding toTableFeatures.getTableFeatures()
.- Returns:
- current value
-
setDescription
Set the property corresponding toDesc.getDescription()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setGroup
Set the property corresponding toGroups.getGroup()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setHardware
Set the property corresponding toDesc.getHardware()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setIpAddress
public FlowCapableNodeBuilder setIpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress value) Set the property corresponding toIpAddressGrouping.getIpAddress()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setManufacturer
Set the property corresponding toDesc.getManufacturer()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMeter
Set the property corresponding toMeters.getMeter()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setPortNumber
public FlowCapableNodeBuilder setPortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber value) Set the property corresponding toPortNumberGrouping.getPortNumber()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSerialNumber
Set the property corresponding toDesc.getSerialNumber()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSoftware
Set the property corresponding toDesc.getSoftware()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setStaleGroup
Set the property corresponding toGroups.getStaleGroup()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setStaleMeter
Set the property corresponding toMeters.getStaleMeter()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setSupportedActions
Set the property corresponding toFlowNode.getSupportedActions()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSupportedInstructions
Set the property corresponding toFlowNode.getSupportedInstructions()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSupportedMatchTypes
Set the property corresponding toFlowNode.getSupportedMatchTypes()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSwitchFeatures
Set the property corresponding toFlowNode.getSwitchFeatures()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTable
Set the property corresponding toTables.getTable()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setTableFeatures
Set the property corresponding toTableFeatures.getTableFeatures()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
build
A newFlowCapableNode
instance.- Returns:
- A new
FlowCapableNode
instance.
-