EntityAdapted class
Annotation that instructs several code generators to generate added features to PODO classes.
As an annotation, it is a substitute for applying
the MapMapped, the Proto, the MapProto, the
DefaultsProvider
, the Validatable, the BuildBuilder
and the CopyWith attributes, driving all the corresponding
code generators to generate code as if driven by those attributes.
Additionally, this class also has an added property, rootEntityType
that drives further code generation when EntityAdapted is
applied to subclasses of rootEntityType, like an EntityAdapter
and an EntityPermissions
subclass.
- Implemented types
- Annotations
-
- @Deprecated('''Use the [AdaptedEntity] annotation, having in attention that [AdaptedEntity] has different default precisions, which is a breaking change from versions below 3.0.0. In order to restore the previous defaults, add a build.yaml file containing the following: # Read about `build.yaml` at https://pub.dev/packages/build_config targets: \$default: builders: squarealfa_entity_adapter_generator:map_map_generator: options: durationPrecision: milliseconds squarealfa_entity_adapter_generator:proto_mapper_generator: options: durationPrecision: milliseconds dateTimePrecision: milliseconds ''')
Constructors
-
EntityAdapted({Type rootEntityType = Object, bool useDefaultsProvider = true, bool includeFieldsByDefault = true, String? prefix = 'G', String packageName = '', bool createDefaultsProviderBaseClass = false, bool createValidatableBaseClass = false, bool createBuilderBaseClass = false, TimePrecision? dateTimePrecision = TimePrecision.microseconds, TimePrecision? durationPrecision = TimePrecision.milliseconds, DateTimeRepresentation? dateTimeRepresentation = DateTimeRepresentation.iso8601String, bool? useProtoFieldNamingConventions = true, List<
Type> ? knownSubClasses, bool allowMissingFields = false, bool mapEnumToString = false}) -
const
Properties
- allowMissingFields → bool
-
final
- createBuilderBaseClass → bool
-
final
- createDefaultsProviderBaseClass → bool
-
final
- createValidatableBaseClass → bool
-
final
- dateTimePrecision → TimePrecision?
-
final
- dateTimeRepresentation → DateTimeRepresentation?
-
final
- durationPrecision → TimePrecision?
-
Defines the level of precision of DateTime and
Duration fields.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- includeFieldsByDefault → bool
-
Determines whether to include all fields by default.
final
-
knownSubClasses
→ List<
Type> ? -
final
- mapEnumToString → bool
-
Defines whether or not to map enum values to their name (as a String)
or to their index (int). Defaults to index.
final
- packageName → String
-
final
- prefix → String?
-
final
- rootEntityType → Type
-
Type that constitutes the root of an
object graph that is to be communicated
and to be persisted. Extra code is generated
for PODOs to which the EntityAdapted is
applied to as an annotation as long as those
PODOs are a subclass of rootEntityType.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useDefaultsProvider → bool
-
final
- useProtoFieldNamingConventions → bool?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited