import ID from '../../trace/ID' ; import { ContextCarrier } from './ContextCarrier' ; export default class SegmentRef { private constructor ( public refType = 'CrossProcess' , public traceId , public segmentId , public spanId , public service , public serviceInstance , public endpoint , public clientAddress ) { this . traceId = traceId ; this . segmentId = segmentId ; this . spanId = spanId ; this . service = service ; this . serviceInstance = serviceInstance ; this . endpoint = endpoint ; this . clientAddress = clientAddress ; } static fromCarrier ( carrier ) { return new SegmentRef ( 'CrossProcess' , carrier . traceId ! , carrier . segmentId ! , carrier . spanId ! , carrier . service ! , carrier . serviceInstance ! , carrier . endpoint ! , carrier . clientAddress ! ) ; } }