{"version":3,"file":"InstrumentSelector.mjs","names":[],"sources":["../../src/view/InstrumentSelector.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Predicate } from './Predicate';\nimport { ExactPredicate, PatternPredicate } from './Predicate';\nimport type { InstrumentType } from '../export/MetricData';\n\nexport interface InstrumentSelectorCriteria {\n  name?: string;\n  type?: InstrumentType;\n  unit?: string;\n}\n\nexport class InstrumentSelector {\n  private _nameFilter: Predicate;\n  private _type?: InstrumentType;\n  private _unitFilter: Predicate;\n\n  constructor(criteria?: InstrumentSelectorCriteria) {\n    this._nameFilter = new PatternPredicate(criteria?.name ?? '*');\n    this._type = criteria?.type;\n    this._unitFilter = new ExactPredicate(criteria?.unit);\n  }\n\n  getType() {\n    return this._type;\n  }\n\n  getNameFilter() {\n    return this._nameFilter;\n  }\n\n  getUnitFilter() {\n    return this._unitFilter;\n  }\n}\n"],"mappings":";;AAeA,IAAa,qBAAb,MAAgC;CAC9B;CACA;CACA;CAEA,YAAY,UAAuC;EACjD,KAAK,cAAc,IAAI,iBAAiB,UAAU,QAAQ,GAAG;EAC7D,KAAK,QAAQ,UAAU;EACvB,KAAK,cAAc,IAAI,eAAe,UAAU,IAAI;CACtD;CAEA,UAAU;EACR,OAAO,KAAK;CACd;CAEA,gBAAgB;EACd,OAAO,KAAK;CACd;CAEA,gBAAgB;EACd,OAAO,KAAK;CACd;AACF"}