use of org.onosproject.net.DefaultAnnotations.Builder in project onos by opennetworkinglab.
the class OtuPortHelper method otuPortDescription.
/**
* Creates OTU port description based on the supplied information.
*
* @param number port number
* @param isEnabled port enabled state
* @param signalType OTU client signal type
* @param annotations key/value annotations map
* @return port description
*/
public static PortDescription otuPortDescription(PortNumber number, boolean isEnabled, OtuSignalType signalType, SparseAnnotations annotations) {
Builder builder = DefaultAnnotations.builder();
builder.putAll(annotations);
builder.set(SIGNAL_TYPE, signalType.toString());
// TODO specify appropriate value?
long portSpeed = 0;
return DefaultPortDescription.builder().withPortNumber(number).isEnabled(isEnabled).type(Port.Type.OTU).portSpeed(portSpeed).annotations(builder.build()).build();
}
Aggregations