Line data Source code
1 : // Copyright The OpenTelemetry Authors
2 : // SPDX-License-Identifier: Apache-2.0
3 :
4 : part of 'resource.dart';
5 :
6 : /// Factory class for creating Resource instances.
7 : ///
8 : /// This class follows the factory pattern and provides a static method
9 : /// for creating new Resource instances.
10 : @internal
11 : class ResourceCreate<T> {
12 : /// Creates a new Resource with the specified attributes and schema URL.
13 : ///
14 : /// This factory method is the recommended way to create Resource instances.
15 : ///
16 : /// @param attributes The attributes describing the resource
17 : /// @param schemaUrl Optional schema URL for the resource attributes
18 : /// @return A new Resource instance
19 128 : static Resource create(Attributes attributes, [String? schemaUrl]) {
20 128 : return Resource._(attributes, schemaUrl);
21 : }
22 : }
|