// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import 'package:meta/meta.dart'; /// {@template amplify_core.token} /// An identifier for [T] and its dependencies. /// {@endtemplate} @immutable class Token { /// {@macro amplify_core.token} const Token(); /// The type identified by this token. Type get type => T; @override bool operator ==(Object other) => identical(this, other) || other is Token && type == other.type; @override int get hashCode => type.hashCode; @override String toString() => '$type'; } /// {@template amplify_core.type_token} /// A token identified by a [Type]. /// {@endtemplate} class TypeToken extends Token { /// {@macro amplify_core.type_token} const TypeToken(this.type); @override final Type type; }