You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/02/04 09:30:58 UTC
[avro] branch branch-1.11 updated: AVRO-3366 Updated naming of variables. (#1517)
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/branch-1.11 by this push:
new bf0f117 AVRO-3366 Updated naming of variables. (#1517)
bf0f117 is described below
commit bf0f1175464e2a8a847ffebb020d8eb3edaee5ee
Author: Kyle Schoonover <ky...@minmaxcorp.com>
AuthorDate: Fri Feb 4 01:30:40 2022 -0800
AVRO-3366 Updated naming of variables. (#1517)
* AVRO-3360 Updated XML documentation
* Revert "AVRO-3360 Updated XML documentation"
This reverts commit b8601c072a5083380d30b580804dd0908b8cf4cc.
* AVRO-3366 Updated naming of variables.
Co-authored-by: Kyle T. Schoonover <Ky...@nordstrom.com>
(cherry picked from commit 6f704b13e4a393bb035cede13e5a2200eb3a1092)
---
lang/csharp/src/apache/main/Generic/GenericEnum.cs | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lang/csharp/src/apache/main/Generic/GenericEnum.cs b/lang/csharp/src/apache/main/Generic/GenericEnum.cs
index 168b555..c646a71 100644
--- a/lang/csharp/src/apache/main/Generic/GenericEnum.cs
+++ b/lang/csharp/src/apache/main/Generic/GenericEnum.cs
@@ -28,29 +28,30 @@ namespace Avro.Generic
/// </summary>
public EnumSchema Schema { get; private set; }
- private string value;
+ private string _value;
/// <summary>
/// Value of the enum.
/// </summary>
- public string Value {
- get { return value; }
+ public string Value
+ {
+ get { return _value; }
set
{
if (!Schema.Contains(value))
{
if (!string.IsNullOrEmpty(Schema.Default))
{
- this.value = Schema.Default;
+ _value = Schema.Default;
}
else
{
- throw new AvroException("Unknown value for enum: " + value + "(" + Schema + ")");
+ throw new AvroException($"Unknown value for enum: {value}({Schema})");
}
}
else
{
- this.value = value;
+ _value = value;
}
}
}
@@ -62,8 +63,8 @@ namespace Avro.Generic
/// <param name="value">Value of the enum.</param>
public GenericEnum(EnumSchema schema, string value)
{
- this.Schema = schema;
- this.Value = value;
+ Schema = schema;
+ Value = value;
}
/// <inheritdoc/>
@@ -86,7 +87,7 @@ namespace Avro.Generic
/// <inheritdoc/>
public override string ToString()
{
- return "Schema: " + Schema + ", value: " + Value;
+ return $"Schema: {Schema}, value: {Value}";
}
}
}