diff --git a/lib/kiota_abstractions.dart b/lib/kiota_abstractions.dart index 3d61789..d8b266f 100644 --- a/lib/kiota_abstractions.dart +++ b/lib/kiota_abstractions.dart @@ -18,11 +18,9 @@ part 'src/api_client_builder.dart'; part 'src/base_request_builder.dart'; part 'src/date_only.dart'; part 'src/error_mappings.dart'; -part 'src/date_only_impl.dart'; part 'src/extensions/date_only_extensions.dart'; part 'src/extensions/map_extensions.dart'; part 'src/extensions/request_information_extensions.dart'; -part 'src/http_headers.dart'; part 'src/extensions/time_only_extensions.dart'; part 'src/http_headers.dart'; part 'src/http_method.dart'; @@ -46,4 +44,3 @@ part 'src/serialization/serialization_writer.dart'; part 'src/serialization/serialization_writer_factory.dart'; part 'src/serialization/serialization_writer_factory_registry.dart'; part 'src/time_only.dart'; -part 'src/time_only_impl.dart'; diff --git a/lib/src/date_only.dart b/lib/src/date_only.dart index 7a53895..66a4520 100644 --- a/lib/src/date_only.dart +++ b/lib/src/date_only.dart @@ -8,9 +8,9 @@ part of '../kiota_abstractions.dart'; /// /// It can only be used to represent a date in the Gregorian calendar. abstract class DateOnly { - /// Extracts the date part of a [DateTime] and creates a new [DateOnlyImpl]. + /// Extracts the date part of a [DateTime] and creates a new [_DateOnlyImpl]. factory DateOnly.fromDateTime(DateTime dateTime) { - return DateOnlyImpl( + return _DateOnlyImpl( day: dateTime.day, month: dateTime.month, year: dateTime.year, @@ -18,20 +18,20 @@ abstract class DateOnly { } /// This factory uses the [DateTime.parse] method to create a new - /// [DateOnlyImpl] instance from a string. + /// [_DateOnlyImpl] instance from a string. factory DateOnly.fromDateTimeString(String dateTimeString) { final date = DateTime.parse(dateTimeString); return DateOnly.fromDateTime(date); } - /// Creates a new [DateOnlyImpl] instance from the provided components. + /// Creates a new [_DateOnlyImpl] instance from the provided components. factory DateOnly.fromComponents( int year, [ int month = 1, int day = 1, ]) { - return DateOnlyImpl( + return _DateOnlyImpl( day: day, month: month, year: year, @@ -47,3 +47,20 @@ abstract class DateOnly { /// Gets the day of the date. int get day; } + +class _DateOnlyImpl implements DateOnly { + _DateOnlyImpl({ + required this.day, + required this.month, + required this.year, + }); + + @override + final int day; + + @override + final int month; + + @override + final int year; +} diff --git a/lib/src/date_only_impl.dart b/lib/src/date_only_impl.dart deleted file mode 100644 index 30206ca..0000000 --- a/lib/src/date_only_impl.dart +++ /dev/null @@ -1,19 +0,0 @@ -part of '../kiota_abstractions.dart'; - -/// Implements the [DateOnly] interface. -class DateOnlyImpl implements DateOnly { - DateOnlyImpl({ - required this.day, - required this.month, - required this.year, - }); - - @override - final int day; - - @override - final int month; - - @override - final int year; -} diff --git a/lib/src/time_only.dart b/lib/src/time_only.dart index 730089d..11469b7 100644 --- a/lib/src/time_only.dart +++ b/lib/src/time_only.dart @@ -6,9 +6,9 @@ part of '../kiota_abstractions.dart'; /// It is used to represent time only values in a serialization format agnostic /// way. abstract class TimeOnly { - /// Extracts the time part of a [DateTime] and creates a new [TimeOnlyImpl]. + /// Extracts the time part of a [DateTime] and creates a new [_TimeOnlyImpl]. factory TimeOnly.fromDateTime(DateTime dateTime) { - return TimeOnlyImpl( + return _TimeOnlyImpl( hours: dateTime.hour, minutes: dateTime.minute, seconds: dateTime.second, @@ -17,21 +17,21 @@ abstract class TimeOnly { } /// This factory uses the [DateTime.parse] method to create a new - /// [TimeOnlyImpl] instance from a string. + /// [_TimeOnlyImpl] instance from a string. factory TimeOnly.fromDateTimeString(String dateTimeString) { final dateTime = DateTime.parse(dateTimeString); return TimeOnly.fromDateTime(dateTime); } - /// Constructs a new [TimeOnlyImpl] instance from the provided components. + /// Constructs a new [_TimeOnlyImpl] instance from the provided components. factory TimeOnly.fromComponents( int hours, int minutes, [ int seconds = 0, int milliseconds = 0, ]) { - return TimeOnlyImpl( + return _TimeOnlyImpl( hours: hours, minutes: minutes, seconds: seconds, @@ -51,3 +51,24 @@ abstract class TimeOnly { /// Gets the milliseconds of the time. int get milliseconds; } + +class _TimeOnlyImpl implements TimeOnly { + _TimeOnlyImpl({ + required this.hours, + required this.minutes, + required this.seconds, + required this.milliseconds, + }); + + @override + final int hours; + + @override + final int minutes; + + @override + final int seconds; + + @override + final int milliseconds; +} diff --git a/lib/src/time_only_impl.dart b/lib/src/time_only_impl.dart deleted file mode 100644 index 43dbceb..0000000 --- a/lib/src/time_only_impl.dart +++ /dev/null @@ -1,23 +0,0 @@ -part of '../kiota_abstractions.dart'; - -/// Implements the [TimeOnly] interface. -class TimeOnlyImpl implements TimeOnly { - TimeOnlyImpl({ - required this.hours, - required this.minutes, - required this.seconds, - required this.milliseconds, - }); - - @override - final int hours; - - @override - final int minutes; - - @override - final int seconds; - - @override - final int milliseconds; -}