Skip to content

Commit

Permalink
rename internal members
Browse files Browse the repository at this point in the history
  • Loading branch information
smdn committed Apr 2, 2024
1 parent e2be534 commit a718378
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ internal static EchonetObjectSpecification CreateUnknown(byte classGroupCode, by
internal EchonetObjectSpecification(byte classGroupCode, byte classCode)
{
ClassGroup =
SpecificationMaster.GetInstance().プロファイル.FirstOrDefault(p => p.Code == classGroupCode) ??
SpecificationMaster.GetInstance().機器.FirstOrDefault(p => p.Code == classGroupCode) ??
SpecificationMaster.GetInstance().Profiles.FirstOrDefault(p => p.Code == classGroupCode) ??
SpecificationMaster.GetInstance().DeviceClasses.FirstOrDefault(p => p.Code == classGroupCode) ??
throw new ArgumentException($"unknown class group: 0x{classGroupCode:X2}");

var properties = new List<EchonetPropertySpecification>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ internal sealed class SpecificationMaster
/// </summary>
/// <param name="version"><see cref="Version"/>に設定する非<see langword="null"/>・長さ非ゼロの値。</param>
/// <param name="appendixRelease"><see cref="AppendixRelease"/>に設定する非<see langword="null"/>・長さ非ゼロの値。</param>
/// <param name="プロファイル"><see cref="プロファイル"/>に設定する非<see langword="null"/>の値。</param>
/// <param name="機器"><see cref="機器"/>に設定する非<see langword="null"/>の値。</param>
/// <param name="profiles"><see cref="Profiles"/>に設定する非<see langword="null"/>の値。</param>
/// <param name="deviceClasses"><see cref="DeviceClasses"/>に設定する非<see langword="null"/>の値。</param>
/// <exception cref="ArgumentNullException"><see langword="null"/>非許容のプロパティに<see langword="null"/>を設定しようとしました。</exception>
/// <exception cref="ArgumentException">プロパティに空の文字列を設定しようとしました。</exception>
[JsonConstructor]
public SpecificationMaster
(
string? version,
string? appendixRelease,
IReadOnlyList<EchonetClassGroupSpecification>? プロファイル,
IReadOnlyList<EchonetClassGroupSpecification>? 機器
IReadOnlyList<EchonetClassGroupSpecification>? profiles,
IReadOnlyList<EchonetClassGroupSpecification>? deviceClasses
)
{
Version = JsonValidationUtils.ThrowIfValueIsNullOrEmpty(version, nameof(version));
AppendixRelease = JsonValidationUtils.ThrowIfValueIsNullOrEmpty(appendixRelease, nameof(appendixRelease));
this.プロファイル = プロファイル ?? throw new ArgumentNullException(nameof(プロファイル));
this.機器 = 機器 ?? throw new ArgumentNullException(nameof(機器));
this.Profiles = profiles ?? throw new ArgumentNullException(nameof(profiles));
this.DeviceClasses = deviceClasses ?? throw new ArgumentNullException(nameof(deviceClasses));
}

/// <summary>
Expand Down Expand Up @@ -96,10 +96,12 @@ internal static Stream GetSpecificationMasterDataStream(string file)
/// <summary>
/// プロファイルオブジェクト
/// </summary>
public IReadOnlyList<EchonetClassGroupSpecification> プロファイル { get; }
[JsonPropertyName("プロファイル")]
public IReadOnlyList<EchonetClassGroupSpecification> Profiles { get; }
/// <summary>
/// 機器オブジェクト
/// </summary>
public IReadOnlyList<EchonetClassGroupSpecification> 機器 { get; }
[JsonPropertyName("機器")]
public IReadOnlyList<EchonetClassGroupSpecification> DeviceClasses { get; }
}
}

0 comments on commit a718378

Please sign in to comment.