use of org.onosproject.net.meter.DefaultBand in project onos by opennetworkinglab.
the class BandProtoTranslator method translate.
/**
* Translates gRPC Band to {@link Band}.
*
* @param gBand gRPC message
* @return {@link Band}
*/
public static Band translate(BandProto gBand) {
Band.Type type = BandEnumsProtoTranslator.translate(gBand.getType()).get();
long rate = gBand.getRate();
long burstSize = gBand.getBurst();
short prec = (short) gBand.getDropPrecedence();
Band band = new DefaultBand(type, rate, burstSize, prec);
return band;
}
Aggregations