Skip to content

Commit

Permalink
change the type name of each type in Smdn.Net.EchonetLite.Appendix to…
Browse files Browse the repository at this point in the history
… the new one
  • Loading branch information
smdn committed Mar 31, 2024
1 parent 1f6b640 commit c4219b2
Show file tree
Hide file tree
Showing 19 changed files with 296 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Smdn.Net.EchonetLite.Appendix
/// <summary>
/// クラスグループ
/// </summary>
public sealed class EchoClassGroup
public sealed class EchonetClassGroupSpecification
{
/// <summary>
/// JSONデシリアライズ用のコンストラクタ
Expand All @@ -19,24 +19,24 @@ public sealed class EchoClassGroup
/// <param name="classGroupNameOfficial"><see cref="ClassGroupNameOfficial"/>に設定する非<see langword="null"/>・長さ非ゼロの値。</param>
/// <param name="classGroupName"><see cref="ClassGroupName"/>に設定する非<see langword="null"/>・長さ非ゼロの値。</param>
/// <param name="superClass"><see cref="SuperClass"/>に設定する値。 スーパークラスがない場合は<see langword="null"/>。 空の文字列は<see langword="null"/>として設定されます。</param>
/// <param name="classList"><see cref="ClassList"/>に設定する値。 <see langword="null"/>が指定された場合は、空の<see cref="IReadOnlyList{EchoClass}"/>を設定します。</param>
/// <param name="classList"><see cref="ClassList"/>に設定する値。 <see langword="null"/>が指定された場合は、空の<see cref="IReadOnlyList{EchonetClassSpecification}"/>を設定します。</param>
/// <exception cref="ArgumentNullException"><see langword="null"/>非許容のプロパティに<see langword="null"/>を設定しようとしました。</exception>
/// <exception cref="ArgumentException">プロパティに空の文字列を設定しようとしました。</exception>
[JsonConstructor]
public EchoClassGroup
public EchonetClassGroupSpecification
(
byte classGroupCode,
string? classGroupNameOfficial,
string? classGroupName,
string? superClass,
IReadOnlyList<EchoClass>? classList
IReadOnlyList<EchonetClassSpecification>? classList
)
{
ClassGroupCode = classGroupCode;
ClassGroupNameOfficial = JsonValidationUtils.ThrowIfValueIsNullOrEmpty(classGroupNameOfficial, nameof(classGroupNameOfficial));
ClassGroupName = JsonValidationUtils.ThrowIfValueIsNullOrEmpty(classGroupName, nameof(classGroupName));
SuperClass = string.IsNullOrEmpty(superClass) ? null : superClass; // can be null
ClassList = classList ?? Array.Empty<EchoClass>();
ClassList = classList ?? Array.Empty<EchonetClassSpecification>();
}

/// <summary>
Expand All @@ -59,6 +59,6 @@ public EchoClassGroup
/// <summary>
/// クラスグループに属するクラスのリスト
/// </summary>
public IReadOnlyList<EchoClass> ClassList { get; }
public IReadOnlyList<EchonetClassSpecification> ClassList { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Smdn.Net.EchonetLite.Appendix
/// <summary>
/// クラス
/// </summary>
public sealed class EchoClass
public sealed class EchonetClassSpecification
{
/// <summary>
/// JSONデシリアライズ用のコンストラクタ
Expand All @@ -21,7 +21,7 @@ public sealed class EchoClass
/// <exception cref="ArgumentNullException"><see langword="null"/>非許容のプロパティに<see langword="null"/>を設定しようとしました。</exception>
/// <exception cref="ArgumentException">プロパティに空の文字列を設定しようとしました。</exception>
[JsonConstructor]
public EchoClass
public EchonetClassSpecification
(
bool status,
byte classCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

namespace Smdn.Net.EchonetLite.Appendix
{
internal class EchonetObject : IEchonetObject
internal class EchonetObjectSpecification : IEchonetObject
{
public EchonetObject(byte classGroupCode, byte classCode)
public EchonetObjectSpecification(byte classGroupCode, byte classCode)
{
ClassGroup =
SpecificationMaster.GetInstance().プロファイル.FirstOrDefault(p => p.ClassGroupCode == classGroupCode) ??
SpecificationMaster.GetInstance().機器.FirstOrDefault(p => p.ClassGroupCode == classGroupCode) ??
throw new ArgumentException($"unknown class group: 0x{classGroupCode:X2}");

var properties = new List<EchoProperty>();
var properties = new List<EchonetPropertySpecification>();

//スーパークラスのプロパティを列挙
using (var stream = SpecificationMaster.GetSpecificationMasterDataStream($"{ClassGroup.SuperClass}.json"))
Expand Down Expand Up @@ -50,35 +50,35 @@ public EchonetObject(byte classGroupCode, byte classCode)
/// <summary>
/// クラスグループコード
/// </summary>
public EchoClassGroup ClassGroup { get; }
public EchonetClassGroupSpecification ClassGroup { get; }
/// <summary>
/// クラスコード
/// </summary>
public EchoClass Class { get; }
public EchonetClassSpecification Class { get; }

/// <summary>
/// 仕様上定義済みのプロパティの一覧
/// </summary>
internal IReadOnlyList<EchoProperty> Properties { get; }
internal IReadOnlyList<EchonetPropertySpecification> Properties { get; }

/// <summary>
/// 仕様上定義済みのGETプロパティの一覧
/// </summary>
public IEnumerable<EchoProperty> GetProperties
public IEnumerable<EchonetPropertySpecification> GetProperties
{
get { return Properties.Where(static p => p.Get); }
}
/// <summary>
/// 仕様上定義済みのSETプロパティの一覧
/// </summary>
public IEnumerable<EchoProperty> SetProperties
public IEnumerable<EchonetPropertySpecification> SetProperties
{
get { return Properties.Where(static p => p.Set); }
}
/// <summary>
/// 仕様上定義済みのANNOプロパティの一覧
/// </summary>
public IEnumerable<EchoProperty> AnnoProperties
public IEnumerable<EchonetPropertySpecification> AnnoProperties
{
get { return Properties.Where(static p => p.Anno); }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Smdn.Net.EchonetLite.Appendix
/// <summary>
/// ECHONET Lite オブジェクトプロパティ
/// </summary>
public sealed class EchoProperty
public sealed class EchonetPropertySpecification
{
/// <summary>
/// JSONデシリアライズ用のコンストラクタ
Expand All @@ -33,13 +33,13 @@ public sealed class EchoProperty
/// <param name="setRequired"><see cref="SetRequired"/>に設定する値。</param>
/// <param name="anno"><see cref="Anno"/>に設定する値。</param>
/// <param name="annoRequired"><see cref="AnnoRequired"/>に設定する値。</param>
/// <param name="optionRequired"><see cref="OptionRequired"/>に設定する値。 <see langword="null"/>が指定された場合は、空の<see cref="IReadOnlyList{ApplicationService}"/>を設定します。</param>
/// <param name="optionRequired"><see cref="OptionRequired"/>に設定する値。 <see langword="null"/>が指定された場合は、空の<see cref="IReadOnlyList{ApplicationServiceName}"/>を設定します。</param>
/// <param name="description"><see cref="Description"/>に設定する値。 <see langword="null"/>または空の場合は、<see langword="null"/>として設定されます。</param>
/// <param name="unit"><see cref="Unit"/>に設定する値。 <see langword="null"/>または空の場合は、<see langword="null"/>として設定されます。</param>
/// <exception cref="ArgumentNullException"><see langword="null"/>非許容のプロパティに<see langword="null"/>を設定しようとしました。</exception>
/// <exception cref="ArgumentException">プロパティに空の文字列を設定しようとしました。</exception>
[JsonConstructor]
public EchoProperty
public EchonetPropertySpecification
(
string? name,
byte code,
Expand All @@ -55,7 +55,7 @@ public EchoProperty
bool setRequired,
bool anno,
bool annoRequired,
IReadOnlyList<ApplicationService>? optionRequired,
IReadOnlyList<ApplicationServiceName>? optionRequired,
string? description,
string? unit
)
Expand All @@ -74,7 +74,7 @@ public EchoProperty
SetRequired = setRequired;
Anno = anno;
AnnoRequired = annoRequired;
OptionRequired = optionRequired ?? Array.Empty<ApplicationService>();
OptionRequired = optionRequired ?? Array.Empty<ApplicationServiceName>();
Description = string.IsNullOrEmpty(description) ? null : description;
Unit = string.IsNullOrEmpty(unit) ? null : unit;

Expand Down Expand Up @@ -156,7 +156,7 @@ public EchoProperty
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
// MasterDataのJSONファイルでは、プロパティ名がOptionRequiredではなくOptionRequierdとなっていることに注意
[JsonPropertyName("OptionRequierd")]
public IReadOnlyList<ApplicationService> OptionRequired { get; }
public IReadOnlyList<ApplicationServiceName> OptionRequired { get; }
/// <summary>
/// 備考
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public PropertyMaster
(
string? version,
string? appendixRelease,
IReadOnlyList<EchoProperty>? properties
IReadOnlyList<EchonetPropertySpecification>? properties
)
{
Version = JsonValidationUtils.ThrowIfValueIsNullOrEmpty(version, nameof(version));
Expand All @@ -43,6 +43,6 @@ public PropertyMaster
/// <summary>
/// プロパティのリスト
/// </summary>
public IReadOnlyList<EchoProperty> Properties { get; }
public IReadOnlyList<EchonetPropertySpecification> Properties { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public SpecificationMaster
(
string? version,
string? appendixRelease,
IReadOnlyList<EchoClassGroup>? プロファイル,
IReadOnlyList<EchoClassGroup>? 機器
IReadOnlyList<EchonetClassGroupSpecification>? プロファイル,
IReadOnlyList<EchonetClassGroupSpecification>? 機器
)
{
Version = JsonValidationUtils.ThrowIfValueIsNullOrEmpty(version, nameof(version));
Expand Down Expand Up @@ -96,10 +96,10 @@ internal static Stream GetSpecificationMasterDataStream(string file)
/// <summary>
/// プロファイルオブジェクト
/// </summary>
public IReadOnlyList<EchoClassGroup> プロファイル { get; }
public IReadOnlyList<EchonetClassGroupSpecification> プロファイル { get; }
/// <summary>
/// 機器オブジェクト
/// </summary>
public IReadOnlyList<EchoClassGroup> 機器 { get; }
public IReadOnlyList<EchonetClassGroupSpecification> 機器 { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Smdn.Net.EchonetLite
/// アプリケーションサービス
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum ApplicationService
public enum ApplicationServiceName
{
/// <summary>
/// (Mobile services)○M
Expand Down
Loading

0 comments on commit c4219b2

Please sign in to comment.