import 'dart:convert';

class LanguageEntity {
  String languageCode;
  String languageName;

  LanguageEntity({
    required this.languageCode,
    required this.languageName,
  });

  LanguageEntity copyWith() => LanguageEntity(
        languageCode: languageCode,
        languageName: languageName,
      );

  factory LanguageEntity.fromJson(String str) =>
      LanguageEntity.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LanguageEntity.fromMap(Map<String, dynamic> json) => LanguageEntity(
        languageCode: json["languageCode"],
        languageName: json["languageName"],
      );

  Map<String, dynamic> toMap() => {
        "languageCode": languageCode,
        "languageName": languageName,
      };
}
