Class NodeConnectorStatisticsAndPortNumberMapBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapBuilder
@Generated("mdsal-binding-generator")
public class NodeConnectorStatisticsAndPortNumberMapBuilder
extends Object
Class that builds
NodeConnectorStatisticsAndPortNumberMap
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:
NodeConnectorStatisticsAndPortNumberMap createNodeConnectorStatisticsAndPortNumberMap(int fooXyzzy, int barBaz) {
return new NodeConnectorStatisticsAndPortNumberMapBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of NodeConnectorStatisticsAndPortNumberMap, 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 specifiedDuration
.Construct a new builder initialized from specifiedNodeConnectorStatistics
.Construct a builder initialized with state from specifiedNodeConnectorStatisticsAndPortNumberMap
. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation
(org.opendaylight.yangtools.yang.binding.Augmentation<NodeConnectorStatisticsAndPortNumberMap> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<NodeConnectorStatisticsAndPortNumberMap>>
E$$augmentation
(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.build()
A newNodeConnectorStatisticsAndPortNumberMap
instance.void
fieldsFrom
(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.getBytes()
Return current value associated with the property corresponding toNodeConnectorStatistics.getBytes()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getCollisionCount()
.Return current value associated with the property corresponding toDuration.getDuration()
.Return current value associated with the property corresponding toNodeConnectorStatisticsAndPortNumberMap.getNodeConnectorId()
.Return current value associated with the property corresponding toNodeConnectorStatistics.getPackets()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveCrcError()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveDrops()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveErrors()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveFrameError()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveOverRunError()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getTransmitDrops()
.org.opendaylight.yangtools.yang.common.Uint64
Return current value associated with the property corresponding toNodeConnectorStatistics.getTransmitErrors()
.key()
Return current value associated with the property corresponding toNodeConnectorStatisticsAndPortNumberMap.key()
.removeAugmentation
(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NodeConnectorStatisticsAndPortNumberMap>> augmentationType) Remove an augmentation from this builder's product.Set the property corresponding toNodeConnectorStatistics.getBytes()
to the specified value.setCollisionCount
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getCollisionCount()
to the specified value.setDuration
(Duration value) Set the property corresponding toDuration.getDuration()
to the specified value.Set the property corresponding toNodeConnectorStatisticsAndPortNumberMap.getNodeConnectorId()
to the specified value.setPackets
(Packets value) Set the property corresponding toNodeConnectorStatistics.getPackets()
to the specified value.setReceiveCrcError
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveCrcError()
to the specified value.setReceiveDrops
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveDrops()
to the specified value.setReceiveErrors
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveErrors()
to the specified value.setReceiveFrameError
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveFrameError()
to the specified value.setReceiveOverRunError
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveOverRunError()
to the specified value.setTransmitDrops
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getTransmitDrops()
to the specified value.setTransmitErrors
(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getTransmitErrors()
to the specified value.Set the key value corresponding toNodeConnectorStatisticsAndPortNumberMap.key()
to the specified value.
-
Constructor Details
-
NodeConnectorStatisticsAndPortNumberMapBuilder
public NodeConnectorStatisticsAndPortNumberMapBuilder()Construct an empty builder. -
NodeConnectorStatisticsAndPortNumberMapBuilder
Construct a new builder initialized from specifiedNodeConnectorStatistics
.- Parameters:
arg
- NodeConnectorStatistics from which the builder should be initialized
-
NodeConnectorStatisticsAndPortNumberMapBuilder
Construct a new builder initialized from specifiedDuration
.- Parameters:
arg
- org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.Duration from which the builder should be initialized
-
NodeConnectorStatisticsAndPortNumberMapBuilder
Construct a builder initialized with state from specifiedNodeConnectorStatisticsAndPortNumberMap
.- Parameters:
base
- NodeConnectorStatisticsAndPortNumberMap 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
-
key
Return current value associated with the property corresponding toNodeConnectorStatisticsAndPortNumberMap.key()
.- Returns:
- current value
-
getBytes
Return current value associated with the property corresponding toNodeConnectorStatistics.getBytes()
.- Returns:
- current value
-
getCollisionCount
public org.opendaylight.yangtools.yang.common.Uint64 getCollisionCount()Return current value associated with the property corresponding toNodeConnectorStatistics.getCollisionCount()
.- Returns:
- current value
-
getDuration
Return current value associated with the property corresponding toDuration.getDuration()
.- Returns:
- current value
-
getNodeConnectorId
Return current value associated with the property corresponding toNodeConnectorStatisticsAndPortNumberMap.getNodeConnectorId()
.- Returns:
- current value
-
getPackets
Return current value associated with the property corresponding toNodeConnectorStatistics.getPackets()
.- Returns:
- current value
-
getReceiveCrcError
public org.opendaylight.yangtools.yang.common.Uint64 getReceiveCrcError()Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveCrcError()
.- Returns:
- current value
-
getReceiveDrops
public org.opendaylight.yangtools.yang.common.Uint64 getReceiveDrops()Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveDrops()
.- Returns:
- current value
-
getReceiveErrors
public org.opendaylight.yangtools.yang.common.Uint64 getReceiveErrors()Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveErrors()
.- Returns:
- current value
-
getReceiveFrameError
public org.opendaylight.yangtools.yang.common.Uint64 getReceiveFrameError()Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveFrameError()
.- Returns:
- current value
-
getReceiveOverRunError
public org.opendaylight.yangtools.yang.common.Uint64 getReceiveOverRunError()Return current value associated with the property corresponding toNodeConnectorStatistics.getReceiveOverRunError()
.- Returns:
- current value
-
getTransmitDrops
public org.opendaylight.yangtools.yang.common.Uint64 getTransmitDrops()Return current value associated with the property corresponding toNodeConnectorStatistics.getTransmitDrops()
.- Returns:
- current value
-
getTransmitErrors
public org.opendaylight.yangtools.yang.common.Uint64 getTransmitErrors()Return current value associated with the property corresponding toNodeConnectorStatistics.getTransmitErrors()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<NodeConnectorStatisticsAndPortNumberMap>> E$$ augmentation(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.- Type Parameters:
E$$
- augmentation type- Parameters:
augmentationType
- augmentation type class- Returns:
- Augmentation object from this builder, or
null
if not present - Throws:
NullPointerException
- ifaugmentType
isnull
-
withKey
public NodeConnectorStatisticsAndPortNumberMapBuilder withKey(NodeConnectorStatisticsAndPortNumberMapKey key) Set the key value corresponding toNodeConnectorStatisticsAndPortNumberMap.key()
to the specified value.- Parameters:
key
- desired value- Returns:
- this builder
-
setBytes
Set the property corresponding toNodeConnectorStatistics.getBytes()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setCollisionCount
public NodeConnectorStatisticsAndPortNumberMapBuilder setCollisionCount(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getCollisionCount()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDuration
Set the property corresponding toDuration.getDuration()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setNodeConnectorId
Set the property corresponding toNodeConnectorStatisticsAndPortNumberMap.getNodeConnectorId()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPackets
Set the property corresponding toNodeConnectorStatistics.getPackets()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setReceiveCrcError
public NodeConnectorStatisticsAndPortNumberMapBuilder setReceiveCrcError(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveCrcError()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setReceiveDrops
public NodeConnectorStatisticsAndPortNumberMapBuilder setReceiveDrops(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveDrops()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setReceiveErrors
public NodeConnectorStatisticsAndPortNumberMapBuilder setReceiveErrors(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveErrors()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setReceiveFrameError
public NodeConnectorStatisticsAndPortNumberMapBuilder setReceiveFrameError(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveFrameError()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setReceiveOverRunError
public NodeConnectorStatisticsAndPortNumberMapBuilder setReceiveOverRunError(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getReceiveOverRunError()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTransmitDrops
public NodeConnectorStatisticsAndPortNumberMapBuilder setTransmitDrops(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getTransmitDrops()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTransmitErrors
public NodeConnectorStatisticsAndPortNumberMapBuilder setTransmitErrors(org.opendaylight.yangtools.yang.common.Uint64 value) Set the property corresponding toNodeConnectorStatistics.getTransmitErrors()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public NodeConnectorStatisticsAndPortNumberMapBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<NodeConnectorStatisticsAndPortNumberMap> 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 NodeConnectorStatisticsAndPortNumberMapBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<NodeConnectorStatisticsAndPortNumberMap>> 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
A newNodeConnectorStatisticsAndPortNumberMap
instance.- Returns:
- A new
NodeConnectorStatisticsAndPortNumberMap
instance.
-