Class PortStatsBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.stats._case.multipart.reply.port.stats.PortStatsBuilder
-
@Generated("mdsal-binding-generator") public class PortStatsBuilder extends Object
Class that buildsPortStats
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:
PortStats createPortStats(int fooXyzzy, int barBaz) { return new PortStatsBuilder() .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) .setBar(new BarBuilder().setBaz(barBaz).build()) .build(); }
This pattern is supported by the immutable nature of PortStats, 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:
PortStats
- 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 PortStatsBuilder()
Construct an empty builder.PortStatsBuilder(PortStats base)
Construct a builder initialized with state from specifiedPortStats
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortStatsBuilder
addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<PortStats> augmentation)
Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<PortStats>>
E$$augmentation(Class<E$$> augmentationType)
Return the specified augmentation, if it is present in this builder.@NonNull PortStats
build()
A newPortStats
instance.org.opendaylight.yangtools.yang.common.Uint64
getCollisions()
Return current value associated with the property corresponding toPortStats.getCollisions()
.org.opendaylight.yangtools.yang.common.Uint32
getDurationNsec()
Return current value associated with the property corresponding toPortStats.getDurationNsec()
.org.opendaylight.yangtools.yang.common.Uint32
getDurationSec()
Return current value associated with the property corresponding toPortStats.getDurationSec()
.org.opendaylight.yangtools.yang.common.Uint32
getPortNo()
Return current value associated with the property corresponding toPortStats.getPortNo()
.org.opendaylight.yangtools.yang.common.Uint64
getRxBytes()
Return current value associated with the property corresponding toPortStats.getRxBytes()
.org.opendaylight.yangtools.yang.common.Uint64
getRxCrcErr()
Return current value associated with the property corresponding toPortStats.getRxCrcErr()
.org.opendaylight.yangtools.yang.common.Uint64
getRxDropped()
Return current value associated with the property corresponding toPortStats.getRxDropped()
.org.opendaylight.yangtools.yang.common.Uint64
getRxErrors()
Return current value associated with the property corresponding toPortStats.getRxErrors()
.org.opendaylight.yangtools.yang.common.Uint64
getRxFrameErr()
Return current value associated with the property corresponding toPortStats.getRxFrameErr()
.org.opendaylight.yangtools.yang.common.Uint64
getRxOverErr()
Return current value associated with the property corresponding toPortStats.getRxOverErr()
.org.opendaylight.yangtools.yang.common.Uint64
getRxPackets()
Return current value associated with the property corresponding toPortStats.getRxPackets()
.org.opendaylight.yangtools.yang.common.Uint64
getTxBytes()
Return current value associated with the property corresponding toPortStats.getTxBytes()
.org.opendaylight.yangtools.yang.common.Uint64
getTxDropped()
Return current value associated with the property corresponding toPortStats.getTxDropped()
.org.opendaylight.yangtools.yang.common.Uint64
getTxErrors()
Return current value associated with the property corresponding toPortStats.getTxErrors()
.org.opendaylight.yangtools.yang.common.Uint64
getTxPackets()
Return current value associated with the property corresponding toPortStats.getTxPackets()
.PortStatsBuilder
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<PortStats>> augmentationType)
Remove an augmentation from this builder's product.PortStatsBuilder
setCollisions(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getCollisions()
to the specified value.PortStatsBuilder
setDurationNsec(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toPortStats.getDurationNsec()
to the specified value.PortStatsBuilder
setDurationSec(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toPortStats.getDurationSec()
to the specified value.PortStatsBuilder
setPortNo(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toPortStats.getPortNo()
to the specified value.PortStatsBuilder
setRxBytes(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxBytes()
to the specified value.PortStatsBuilder
setRxCrcErr(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxCrcErr()
to the specified value.PortStatsBuilder
setRxDropped(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxDropped()
to the specified value.PortStatsBuilder
setRxErrors(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxErrors()
to the specified value.PortStatsBuilder
setRxFrameErr(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxFrameErr()
to the specified value.PortStatsBuilder
setRxOverErr(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxOverErr()
to the specified value.PortStatsBuilder
setRxPackets(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxPackets()
to the specified value.PortStatsBuilder
setTxBytes(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxBytes()
to the specified value.PortStatsBuilder
setTxDropped(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxDropped()
to the specified value.PortStatsBuilder
setTxErrors(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxErrors()
to the specified value.PortStatsBuilder
setTxPackets(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxPackets()
to the specified value.
-
-
-
Method Detail
-
getCollisions
public org.opendaylight.yangtools.yang.common.Uint64 getCollisions()
Return current value associated with the property corresponding toPortStats.getCollisions()
.- Returns:
- current value
-
getDurationNsec
public org.opendaylight.yangtools.yang.common.Uint32 getDurationNsec()
Return current value associated with the property corresponding toPortStats.getDurationNsec()
.- Returns:
- current value
-
getDurationSec
public org.opendaylight.yangtools.yang.common.Uint32 getDurationSec()
Return current value associated with the property corresponding toPortStats.getDurationSec()
.- Returns:
- current value
-
getPortNo
public org.opendaylight.yangtools.yang.common.Uint32 getPortNo()
Return current value associated with the property corresponding toPortStats.getPortNo()
.- Returns:
- current value
-
getRxBytes
public org.opendaylight.yangtools.yang.common.Uint64 getRxBytes()
Return current value associated with the property corresponding toPortStats.getRxBytes()
.- Returns:
- current value
-
getRxCrcErr
public org.opendaylight.yangtools.yang.common.Uint64 getRxCrcErr()
Return current value associated with the property corresponding toPortStats.getRxCrcErr()
.- Returns:
- current value
-
getRxDropped
public org.opendaylight.yangtools.yang.common.Uint64 getRxDropped()
Return current value associated with the property corresponding toPortStats.getRxDropped()
.- Returns:
- current value
-
getRxErrors
public org.opendaylight.yangtools.yang.common.Uint64 getRxErrors()
Return current value associated with the property corresponding toPortStats.getRxErrors()
.- Returns:
- current value
-
getRxFrameErr
public org.opendaylight.yangtools.yang.common.Uint64 getRxFrameErr()
Return current value associated with the property corresponding toPortStats.getRxFrameErr()
.- Returns:
- current value
-
getRxOverErr
public org.opendaylight.yangtools.yang.common.Uint64 getRxOverErr()
Return current value associated with the property corresponding toPortStats.getRxOverErr()
.- Returns:
- current value
-
getRxPackets
public org.opendaylight.yangtools.yang.common.Uint64 getRxPackets()
Return current value associated with the property corresponding toPortStats.getRxPackets()
.- Returns:
- current value
-
getTxBytes
public org.opendaylight.yangtools.yang.common.Uint64 getTxBytes()
Return current value associated with the property corresponding toPortStats.getTxBytes()
.- Returns:
- current value
-
getTxDropped
public org.opendaylight.yangtools.yang.common.Uint64 getTxDropped()
Return current value associated with the property corresponding toPortStats.getTxDropped()
.- Returns:
- current value
-
getTxErrors
public org.opendaylight.yangtools.yang.common.Uint64 getTxErrors()
Return current value associated with the property corresponding toPortStats.getTxErrors()
.- Returns:
- current value
-
getTxPackets
public org.opendaylight.yangtools.yang.common.Uint64 getTxPackets()
Return current value associated with the property corresponding toPortStats.getTxPackets()
.- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<PortStats>> 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
-
setCollisions
public PortStatsBuilder setCollisions(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getCollisions()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDurationNsec
public PortStatsBuilder setDurationNsec(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toPortStats.getDurationNsec()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setDurationSec
public PortStatsBuilder setDurationSec(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toPortStats.getDurationSec()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setPortNo
public PortStatsBuilder setPortNo(org.opendaylight.yangtools.yang.common.Uint32 value)
Set the property corresponding toPortStats.getPortNo()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxBytes
public PortStatsBuilder setRxBytes(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxBytes()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxCrcErr
public PortStatsBuilder setRxCrcErr(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxCrcErr()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxDropped
public PortStatsBuilder setRxDropped(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxDropped()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxErrors
public PortStatsBuilder setRxErrors(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxErrors()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxFrameErr
public PortStatsBuilder setRxFrameErr(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxFrameErr()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxOverErr
public PortStatsBuilder setRxOverErr(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxOverErr()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setRxPackets
public PortStatsBuilder setRxPackets(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getRxPackets()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTxBytes
public PortStatsBuilder setTxBytes(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxBytes()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTxDropped
public PortStatsBuilder setTxDropped(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxDropped()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTxErrors
public PortStatsBuilder setTxErrors(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxErrors()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
setTxPackets
public PortStatsBuilder setTxPackets(org.opendaylight.yangtools.yang.common.Uint64 value)
Set the property corresponding toPortStats.getTxPackets()
to the specified value.- Parameters:
value
- desired value- Returns:
- this builder
-
addAugmentation
public PortStatsBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<PortStats> 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 PortStatsBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<PortStats>> 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
-
-