rama creada apartir de master en j
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response payload for a beacon, encapsulating its color, point-of-contact identifier, and associated unit identifier.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Implements <see cref="IEquatable{T}"/> to enable value-based equality comparison between <see cref="BeaconResponse"/> instances.
|
||||
/// </remarks>
|
||||
public class BeaconResponse(string color, ObjectId poc, ObjectId unitId) : IEquatable<BeaconResponse>
|
||||
{
|
||||
private string Color { get; } = color;
|
||||
@@ -9,13 +15,22 @@ public class BeaconResponse(string color, ObjectId poc, ObjectId unitId) : IEqua
|
||||
|
||||
private ObjectId UnitId { get; } = unitId;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="BeaconResponse"/> is equal to the current instance by comparing their <c>PointOfCareId</c> and <c>UnitId</c> values.
|
||||
/// </summary>
|
||||
/// <param name="other">The <see cref="BeaconResponse"/> to compare with the current instance.</param>
|
||||
/// <returns><see langword="true"/> if both <c>PointOfCareId</c> and <c>UnitId</c> match; otherwise, <see langword="false"/>.</returns>
|
||||
public bool Equals(BeaconResponse? other)
|
||||
{
|
||||
return PointOfCareId == other?.PointOfCareId && UnitId == other.UnitId;
|
||||
}
|
||||
{
|
||||
return PointOfCareId == other?.PointOfCareId && UnitId == other.UnitId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of the BeaconResponse, including the point of care identifier, unit (bed) identifier, and color.
|
||||
/// </summary>
|
||||
/// <returns>A formatted string describing the beacon's point of care, unit, and color.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return "BeaconResponse[pointOfCare: " + PointOfCareId + ", bed: " + UnitId + ", color: " + Color + "]";
|
||||
}
|
||||
{
|
||||
return "BeaconResponse[pointOfCare: " + PointOfCareId + ", bed: " + UnitId + ", color: " + Color + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user