Search in sources :

Example 1 with DefaultBand

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;
}
Also used : DefaultBand(org.onosproject.net.meter.DefaultBand) DefaultBand(org.onosproject.net.meter.DefaultBand) Band(org.onosproject.net.meter.Band)

Aggregations

Band (org.onosproject.net.meter.Band)1 DefaultBand (org.onosproject.net.meter.DefaultBand)1