Class OvsdbNodeAugmentationBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentationBuilder
Class that builds
OvsdbNodeAugmentation
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:
OvsdbNodeAugmentation createOvsdbNodeAugmentation(int fooXyzzy, int barBaz) {
return new OvsdbNodeAugmentationBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of OvsdbNodeAugmentation, 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 specifiedOvsdbNodeAttributes
.Construct a builder initialized with state from specifiedOvsdbNodeAugmentation
. -
Method Summary
Modifier and TypeMethodDescription@NonNull OvsdbNodeAugmentation
build()
A newOvsdbNodeAugmentation
instance.void
fieldsFrom
(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.Return current value associated with the property corresponding toOvsdbNodeAttributes.getAutoattach()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getConnectionInfo()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getDatapathTypeEntry()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getDbVersion()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getInterfaceTypeEntry()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getManagedNodeEntry()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getManagerEntry()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getOpenvswitchExternalIds()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getOpenvswitchOtherConfigs()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getOvsVersion()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getQosEntries()
.Return current value associated with the property corresponding toOvsdbNodeAttributes.getQueues()
.setAutoattach
(Map<AutoattachKey, Autoattach> values) Set the property corresponding toOvsdbNodeAttributes.getAutoattach()
to the specified value.setConnectionInfo
(ConnectionInfo value) Set the property corresponding toOvsdbNodeAttributes.getConnectionInfo()
to the specified value.Set the property corresponding toOvsdbNodeAttributes.getDatapathTypeEntry()
to the specified value.setDbVersion
(String value) Set the property corresponding toOvsdbNodeAttributes.getDbVersion()
to the specified value.Set the property corresponding toOvsdbNodeAttributes.getInterfaceTypeEntry()
to the specified value.Set the property corresponding toOvsdbNodeAttributes.getManagedNodeEntry()
to the specified value.setManagerEntry
(Map<ManagerEntryKey, ManagerEntry> values) Set the property corresponding toOvsdbNodeAttributes.getManagerEntry()
to the specified value.Set the property corresponding toOvsdbNodeAttributes.getOpenvswitchExternalIds()
to the specified value.Set the property corresponding toOvsdbNodeAttributes.getOpenvswitchOtherConfigs()
to the specified value.setOvsVersion
(String value) Set the property corresponding toOvsdbNodeAttributes.getOvsVersion()
to the specified value.setQosEntries
(Map<QosEntriesKey, QosEntries> values) Set the property corresponding toOvsdbNodeAttributes.getQosEntries()
to the specified value.Set the property corresponding toOvsdbNodeAttributes.getQueues()
to the specified value.
-
Constructor Details
-
OvsdbNodeAugmentationBuilder
public OvsdbNodeAugmentationBuilder()Construct an empty builder. -
OvsdbNodeAugmentationBuilder
Construct a new builder initialized from specifiedOvsdbNodeAttributes
.- Parameters:
arg
- OvsdbNodeAttributes from which the builder should be initialized
-
OvsdbNodeAugmentationBuilder
Construct a builder initialized with state from specifiedOvsdbNodeAugmentation
.- Parameters:
base
- OvsdbNodeAugmentation 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
-
getAutoattach
Return current value associated with the property corresponding toOvsdbNodeAttributes.getAutoattach()
.- Returns:
- current value
-
getConnectionInfo
Return current value associated with the property corresponding toOvsdbNodeAttributes.getConnectionInfo()
.- Returns:
- current value
-
getDatapathTypeEntry
Return current value associated with the property corresponding toOvsdbNodeAttributes.getDatapathTypeEntry()
.- Returns:
- current value
-
getDbVersion
Return current value associated with the property corresponding toOvsdbNodeAttributes.getDbVersion()
.- Returns:
- current value
-
getInterfaceTypeEntry
Return current value associated with the property corresponding toOvsdbNodeAttributes.getInterfaceTypeEntry()
.- Returns:
- current value
-
getManagedNodeEntry
Return current value associated with the property corresponding toOvsdbNodeAttributes.getManagedNodeEntry()
.- Returns:
- current value
-
getManagerEntry
Return current value associated with the property corresponding toOvsdbNodeAttributes.getManagerEntry()
.- Returns:
- current value
-
getOpenvswitchExternalIds
Return current value associated with the property corresponding toOvsdbNodeAttributes.getOpenvswitchExternalIds()
.- Returns:
- current value
-
getOpenvswitchOtherConfigs
Return current value associated with the property corresponding toOvsdbNodeAttributes.getOpenvswitchOtherConfigs()
.- Returns:
- current value
-
getOvsVersion
Return current value associated with the property corresponding toOvsdbNodeAttributes.getOvsVersion()
.- Returns:
- current value
-
getQosEntries
Return current value associated with the property corresponding toOvsdbNodeAttributes.getQosEntries()
.- Returns:
- current value
-
getQueues
Return current value associated with the property corresponding toOvsdbNodeAttributes.getQueues()
.- Returns:
- current value
-
setAutoattach
Set the property corresponding toOvsdbNodeAttributes.getAutoattach()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setConnectionInfo
Set the property corresponding toOvsdbNodeAttributes.getConnectionInfo()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDatapathTypeEntry
public OvsdbNodeAugmentationBuilder setDatapathTypeEntry(Map<DatapathTypeEntryKey, DatapathTypeEntry> values) Set the property corresponding toOvsdbNodeAttributes.getDatapathTypeEntry()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setDbVersion
Set the property corresponding toOvsdbNodeAttributes.getDbVersion()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setInterfaceTypeEntry
public OvsdbNodeAugmentationBuilder setInterfaceTypeEntry(Map<InterfaceTypeEntryKey, InterfaceTypeEntry> values) Set the property corresponding toOvsdbNodeAttributes.getInterfaceTypeEntry()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setManagedNodeEntry
public OvsdbNodeAugmentationBuilder setManagedNodeEntry(Map<ManagedNodeEntryKey, ManagedNodeEntry> values) Set the property corresponding toOvsdbNodeAttributes.getManagedNodeEntry()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setManagerEntry
Set the property corresponding toOvsdbNodeAttributes.getManagerEntry()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setOpenvswitchExternalIds
public OvsdbNodeAugmentationBuilder setOpenvswitchExternalIds(Map<OpenvswitchExternalIdsKey, OpenvswitchExternalIds> values) Set the property corresponding toOvsdbNodeAttributes.getOpenvswitchExternalIds()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setOpenvswitchOtherConfigs
public OvsdbNodeAugmentationBuilder setOpenvswitchOtherConfigs(Map<OpenvswitchOtherConfigsKey, OpenvswitchOtherConfigs> values) Set the property corresponding toOvsdbNodeAttributes.getOpenvswitchOtherConfigs()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setOvsVersion
Set the property corresponding toOvsdbNodeAttributes.getOvsVersion()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setQosEntries
Set the property corresponding toOvsdbNodeAttributes.getQosEntries()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
setQueues
Set the property corresponding toOvsdbNodeAttributes.getQueues()
to the specified value.- Parameters:
values
- desired value- Returns:
- this builder
-
build
A newOvsdbNodeAugmentation
instance.- Returns:
- A new
OvsdbNodeAugmentation
instance.
-