Line data Source code
1 : // Licensed under the Apache License, Version 2.0
2 : // Copyright 2025, Michael Bushe, All rights reserved.
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 : class ResourceCreate<T> {
11 : /// Creates a new Resource with the specified attributes and schema URL.
12 : ///
13 : /// This factory method is the recommended way to create Resource instances.
14 : ///
15 : /// @param attributes The attributes describing the resource
16 : /// @param schemaUrl Optional schema URL for the resource attributes
17 : /// @return A new Resource instance
18 73 : static Resource create(Attributes attributes, [String? schemaUrl]) {
19 73 : return Resource._(attributes, schemaUrl);
20 : }
21 : }
|