public static final BigDecimal toMetricValue(Counter32 counter32){ if(counter32!=null) return new BigDecimal(counter32.getValue()); return BigDecimal.ZERO; }
public static Counter32 getDefaultInstance(String defaultValue) { return new Counter32(java.lang.Long.valueOf(defaultValue)); }
@ConstructorProperties("value") public Counter32(java.lang.Long _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_daysOfWeek == null) ? 0 : _daysOfWeek.hashCode()); result = prime * result + ((_duraction == null) ? 0 : _duraction.hashCode()); result = prime * result + ((_everyNWeeks == null) ? 0 : _everyNWeeks.hashCode()); result = prime * result + ((_startTime == null) ? 0 : _startTime.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }
return false; } else if(!_everyNWeeks.equals(other.getEveryNWeeks())) { return false;
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_discontinuityTime == null) ? 0 : _discontinuityTime.hashCode()); result = prime * result + ((_inBroadcastPkts == null) ? 0 : _inBroadcastPkts.hashCode()); result = prime * result + ((_inDiscards == null) ? 0 : _inDiscards.hashCode()); result = prime * result + ((_inErrors == null) ? 0 : _inErrors.hashCode()); result = prime * result + ((_inMulticastPkts == null) ? 0 : _inMulticastPkts.hashCode()); result = prime * result + ((_inOctets == null) ? 0 : _inOctets.hashCode()); result = prime * result + ((_inUnicastPkts == null) ? 0 : _inUnicastPkts.hashCode()); result = prime * result + ((_inUnknownProtos == null) ? 0 : _inUnknownProtos.hashCode()); result = prime * result + ((_outBroadcastPkts == null) ? 0 : _outBroadcastPkts.hashCode()); result = prime * result + ((_outDiscards == null) ? 0 : _outDiscards.hashCode()); result = prime * result + ((_outErrors == null) ? 0 : _outErrors.hashCode()); result = prime * result + ((_outMulticastPkts == null) ? 0 : _outMulticastPkts.hashCode()); result = prime * result + ((_outOctets == null) ? 0 : _outOctets.hashCode()); result = prime * result + ((_outUnicastPkts == null) ? 0 : _outUnicastPkts.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }
return false; } else if(!_inDiscards.equals(other.getInDiscards())) { return false; return false; } else if(!_inErrors.equals(other.getInErrors())) { return false; return false; } else if(!_inUnknownProtos.equals(other.getInUnknownProtos())) { return false; return false; } else if(!_outDiscards.equals(other.getOutDiscards())) { return false; return false; } else if(!_outErrors.equals(other.getOutErrors())) { return false;
/** * Return the value in the given 32-bit counter. * * @param c The 32-bit counter. * @return A double value configured in the given counter. * Node that zero is returned if {@code c} is invalid. */ public static double doubleValue(Counter32 c) { if (c != null) { Long v = c.getValue(); if (v != null) { return v.doubleValue(); } } return 0d; }
public static Counter32 getDefaultInstance(String defaultValue) { return new Counter32(Long.valueOf(defaultValue)); }
@ConstructorProperties("value") public Counter32(java.lang.Long _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
/** * Return the value in the given 32-bit counter. * * @param c The 32-bit counter. * @return A long value configured in the given counter. * Node that zero is returned if {@code c} is invalid. */ public static long longValue(Counter32 c) { if (c != null) { Long v = c.getValue(); if (v != null) { return v.longValue(); } } return 0; }
public static Counter32 getDefaultInstance(String defaultValue) { return new Counter32(Long.valueOf(defaultValue)); }
@ConstructorProperties("value") public Counter32(java.lang.Long _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
public StatisticsBuilder setOutErrors(Counter32 value) { if (value != null) { checkOutErrorsRange(value.getValue()); } this._outErrors = value; return this; } /**
public static Counter32 getDefaultInstance(String defaultValue) { return new Counter32(Long.valueOf(defaultValue)); }
@ConstructorProperties("value") public Counter32(Long _value) { if (_value != null) { check_valueRange(_value); } Objects.requireNonNull(_value, "Supplied value may not be null"); this._value = _value; }
public StatisticsBuilder setInUnknownProtos(Counter32 value) { if (value != null) { checkInUnknownProtosRange(value.getValue()); } this._inUnknownProtos = value; return this; } /**
/** * Create a dummy flow statistics for the specified flow entry. * * @param flow The MD-SAL flow entry. * @return A dummy flow statistics information. */ public static FlowAndStatisticsMapList getStatistics(Flow flow) { Duration duration = new DurationBuilder(). setSecond(new Counter32(DURATION_SEC)). setNanosecond(new Counter32(DURATION_NANOSEC)). build(); return new FlowAndStatisticsMapListBuilder(flow). setPacketCount(new Counter64(BigInteger.valueOf(PACKET_COUNT))). setByteCount(new Counter64(BigInteger.valueOf(BYTE_COUNT))). setDuration(duration). build(); }
public StatisticsBuilder setInDiscards(Counter32 value) { if (value != null) { checkInDiscardsRange(value.getValue()); } this._inDiscards = value; return this; } /**
@Override public List<GroupStats> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats> source, VersionConvertorData data) { List<GroupStats> convertedSALGroups = new ArrayList<>(); for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply .multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats groupStats : source) { GroupStatsBuilder salGroupStats = new GroupStatsBuilder(); salGroupStats.setBuckets(toSALBuckets(groupStats.getBucketStats())); salGroupStats.setByteCount(new Counter64(groupStats.getByteCount())); DurationBuilder time = new DurationBuilder(); time.setSecond(new Counter32(groupStats.getDurationSec())); time.setNanosecond(new Counter32(groupStats.getDurationNsec())); salGroupStats.setDuration(time.build()); salGroupStats.setGroupId(new GroupId(groupStats.getGroupId().getValue())); salGroupStats.setPacketCount(new Counter64(groupStats.getPacketCount())); salGroupStats.setRefCount(new Counter32(groupStats.getRefCount())); salGroupStats.setKey(new GroupStatsKey(salGroupStats.getGroupId())); convertedSALGroups.add(salGroupStats.build()); } return convertedSALGroups; } }