Class FlowCapableNodeBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder
-
@Generated("mdsal-binding-generator") public class FlowCapableNodeBuilder extends Object
Class that buildsFlowCapableNode
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:
FlowCapableNode
- 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 FlowCapableNodeBuilder()
Construct an empty builder.FlowCapableNodeBuilder(Desc arg)
Construct a new builder initialized from specifiedDesc
.FlowCapableNodeBuilder(FlowCapableNode base)
Construct a builder initialized with state from specifiedFlowCapableNode
.FlowCapableNodeBuilder(FlowNode arg)
Construct a new builder initialized from specifiedFlowNode
.FlowCapableNodeBuilder(IpAddressGrouping arg)
Construct a new builder initialized from specifiedIpAddressGrouping
.FlowCapableNodeBuilder(Meters arg)
Construct a new builder initialized from specifiedMeters
.FlowCapableNodeBuilder(PortNumberGrouping arg)
Construct a new builder initialized from specifiedPortNumberGrouping
.FlowCapableNodeBuilder(Tables arg)
Construct a new builder initialized from specifiedTables
.FlowCapableNodeBuilder(Groups arg)
Construct a new builder initialized from specifiedGroups
.FlowCapableNodeBuilder(TableFeatures arg)
Construct a new builder initialized from specifiedTableFeatures
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull FlowCapableNode
build()
A newFlowCapableNode
instance.void
fieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)
Set fields from given grouping argument.String
getDescription()
Return current value associated with the property corresponding toDesc.getDescription()
.Map<GroupKey,Group>
getGroup()
Return current value associated with the property corresponding toGroups.getGroup()
.String
getHardware()
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
getIpAddress()
Return current value associated with the property corresponding toIpAddressGrouping.getIpAddress()
.String
getManufacturer()
Return current value associated with the property corresponding toDesc.getManufacturer()
.Map<MeterKey,Meter>
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
getPortNumber()
Return current value associated with the property corresponding toPortNumberGrouping.getPortNumber()
.String
getSerialNumber()
Return current value associated with the property corresponding toDesc.getSerialNumber()
.String
getSoftware()
Return current value associated with the property corresponding toDesc.getSoftware()
.Map<StaleGroupKey,StaleGroup>
getStaleGroup()
Return current value associated with the property corresponding toGroups.getStaleGroup()
.Map<StaleMeterKey,StaleMeter>
getStaleMeter()
Return current value associated with the property corresponding toMeters.getStaleMeter()
.SupportedActions
getSupportedActions()
Return current value associated with the property corresponding toFlowNode.getSupportedActions()
.SupportedInstructions
getSupportedInstructions()
Return current value associated with the property corresponding toFlowNode.getSupportedInstructions()
.SupportedMatchTypes
getSupportedMatchTypes()
Return current value associated with the property corresponding toFlowNode.getSupportedMatchTypes()
.SwitchFeatures
getSwitchFeatures()
Return current value associated with the property corresponding toFlowNode.getSwitchFeatures()
.Map<TableKey,Table>
getTable()
Return current value associated with the property corresponding toTables.getTable()
.Map<TableFeaturesKey,TableFeatures>
getTableFeatures()
Return current value associated with the property corresponding toTableFeatures.getTableFeatures()
.FlowCapableNodeBuilder
setDescription(String value)
Set the property corresponding toDesc.getDescription()
to the specified value.FlowCapableNodeBuilder
setGroup(Map<GroupKey,Group> values)
Set the property corresponding toGroups.getGroup()
to the specified value.FlowCapableNodeBuilder
setHardware(String value)
Set the property corresponding toDesc.getHardware()
to the specified value.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.FlowCapableNodeBuilder
setManufacturer(String value)
Set the property corresponding toDesc.getManufacturer()
to the specified value.FlowCapableNodeBuilder
setMeter(Map<MeterKey,Meter> values)
Set the property corresponding toMeters.getMeter()
to the specified value.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.FlowCapableNodeBuilder
setSerialNumber(String value)
Set the property corresponding toDesc.getSerialNumber()
to the specified value.FlowCapableNodeBuilder
setSoftware(String value)
Set the property corresponding toDesc.getSoftware()
to the specified value.FlowCapableNodeBuilder
setStaleGroup(Map<StaleGroupKey,StaleGroup> values)
Set the property corresponding toGroups.getStaleGroup()
to the specified value.FlowCapableNodeBuilder
setStaleMeter(Map<StaleMeterKey,StaleMeter> values)
Set the property corresponding toMeters.getStaleMeter()
to the specified value.FlowCapableNodeBuilder
setSupportedActions(SupportedActions value)
Set the property corresponding toFlowNode.getSupportedActions()
to the specified value.FlowCapableNodeBuilder
setSupportedInstructions(SupportedInstructions value)
Set the property corresponding toFlowNode.getSupportedInstructions()
to the specified value.FlowCapableNodeBuilder
setSupportedMatchTypes(SupportedMatchTypes value)
Set the property corresponding toFlowNode.getSupportedMatchTypes()
to the specified value.FlowCapableNodeBuilder
setSwitchFeatures(SwitchFeatures value)
Set the property corresponding toFlowNode.getSwitchFeatures()
to the specified value.FlowCapableNodeBuilder
setTable(Map<TableKey,Table> values)
Set the property corresponding toTables.getTable()
to the specified value.FlowCapableNodeBuilder
setTableFeatures(Map<TableFeaturesKey,TableFeatures> values)
Set the property corresponding toTableFeatures.getTableFeatures()
to the specified value.
-
-
-
Constructor Detail
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder()
Construct an empty builder.
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(FlowNode arg)
Construct a new builder initialized from specifiedFlowNode
.- Parameters:
arg
- FlowNode from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Desc arg)
Construct a new builder initialized from specifiedDesc
.- Parameters:
arg
- Desc from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Tables arg)
Construct a new builder initialized from specifiedTables
.- Parameters:
arg
- Tables from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(TableFeatures arg)
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
public FlowCapableNodeBuilder(Groups arg)
Construct a new builder initialized from specifiedGroups
.- Parameters:
arg
- Groups from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(Meters arg)
Construct a new builder initialized from specifiedMeters
.- Parameters:
arg
- Meters from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(IpAddressGrouping arg)
Construct a new builder initialized from specifiedIpAddressGrouping
.- Parameters:
arg
- IpAddressGrouping from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(PortNumberGrouping arg)
Construct a new builder initialized from specifiedPortNumberGrouping
.- Parameters:
arg
- PortNumberGrouping from which the builder should be initialized
-
FlowCapableNodeBuilder
public FlowCapableNodeBuilder(FlowCapableNode base)
Construct a builder initialized with state from specifiedFlowCapableNode
.- Parameters:
base
- FlowCapableNode 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
-
getDescription
public String getDescription()
Return current value associated with the property corresponding toDesc.getDescription()
.- Returns:
- current value
-
getGroup
public Map<GroupKey,Group> getGroup()
Return current value associated with the property corresponding toGroups.getGroup()
.- Returns:
- current value
-
getHardware
public String 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
public String getManufacturer()
Return current value associated with the property corresponding toDesc.getManufacturer()
.- Returns:
- current value
-
getMeter
public Map<MeterKey,Meter> 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
public String getSerialNumber()
Return current value associated with the property corresponding toDesc.getSerialNumber()
.- Returns:
- current value
-
getSoftware
public String getSoftware()
Return current value associated with the property corresponding toDesc.getSoftware()
.- Returns:
- current value
-
getStaleGroup
public Map<StaleGroupKey,StaleGroup> getStaleGroup()
Return current value associated with the property corresponding toGroups.getStaleGroup()
.- Returns:
- current value
-
getStaleMeter
public Map<StaleMeterKey,StaleMeter> getStaleMeter()
Return current value associated with the property corresponding toMeters.getStaleMeter()
.- Returns:
- current value
-
getSupportedActions
public SupportedActions getSupportedActions()
Return current value associated with the property corresponding toFlowNode.getSupportedActions()
.- Returns:
- current value
-
getSupportedInstructions
public SupportedInstructions getSupportedInstructions()
Return current value associated with the property corresponding toFlowNode.getSupportedInstructions()
.- Returns:
- current value
-
getSupportedMatchTypes
public SupportedMatchTypes getSupportedMatchTypes()
Return current value associated with the property corresponding toFlowNode.getSupportedMatchTypes()
.- Returns:
- current value
-
getSwitchFeatures
public SwitchFeatures getSwitchFeatures()
Return current value associated with the property corresponding toFlowNode.getSwitchFeatures()
.- Returns:
- current value
-
getTable
public Map<TableKey,Table> getTable()
Return current value associated with the property corresponding toTables.getTable()
.- Returns:
- current value
-
getTableFeatures
public Map<TableFeaturesKey,TableFeatures> getTableFeatures()
Return current value associated with the property corresponding toTableFeatures.getTableFeatures()
.- Returns:
- current value
-
setDescription
public FlowCapableNodeBuilder setDescription(String value)
Set the property corresponding toDesc.getDescription()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setGroup
public FlowCapableNodeBuilder setGroup(Map<GroupKey,Group> values)
Set the property corresponding toGroups.getGroup()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setHardware
public FlowCapableNodeBuilder setHardware(String value)
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
public FlowCapableNodeBuilder setManufacturer(String value)
Set the property corresponding toDesc.getManufacturer()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setMeter
public FlowCapableNodeBuilder setMeter(Map<MeterKey,Meter> values)
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
public FlowCapableNodeBuilder setSerialNumber(String value)
Set the property corresponding toDesc.getSerialNumber()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSoftware
public FlowCapableNodeBuilder setSoftware(String value)
Set the property corresponding toDesc.getSoftware()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setStaleGroup
public FlowCapableNodeBuilder setStaleGroup(Map<StaleGroupKey,StaleGroup> values)
Set the property corresponding toGroups.getStaleGroup()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setStaleMeter
public FlowCapableNodeBuilder setStaleMeter(Map<StaleMeterKey,StaleMeter> values)
Set the property corresponding toMeters.getStaleMeter()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setSupportedActions
public FlowCapableNodeBuilder setSupportedActions(SupportedActions value)
Set the property corresponding toFlowNode.getSupportedActions()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSupportedInstructions
public FlowCapableNodeBuilder setSupportedInstructions(SupportedInstructions value)
Set the property corresponding toFlowNode.getSupportedInstructions()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSupportedMatchTypes
public FlowCapableNodeBuilder setSupportedMatchTypes(SupportedMatchTypes value)
Set the property corresponding toFlowNode.getSupportedMatchTypes()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setSwitchFeatures
public FlowCapableNodeBuilder setSwitchFeatures(SwitchFeatures value)
Set the property corresponding toFlowNode.getSwitchFeatures()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTable
public FlowCapableNodeBuilder setTable(Map<TableKey,Table> values)
Set the property corresponding toTables.getTable()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setTableFeatures
public FlowCapableNodeBuilder setTableFeatures(Map<TableFeaturesKey,TableFeatures> values)
Set the property corresponding toTableFeatures.getTableFeatures()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
build
public @NonNull FlowCapableNode build()
A newFlowCapableNode
instance.- Returns:
- A new
FlowCapableNode
instance.
-
-