Skip to content

Commit

Permalink
Seal Oid to prevent harm when someone change the Oid impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed May 22, 2010
1 parent 313c9fe commit 91c4af4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/MongoDB/Oid.cs
Expand Up @@ -11,7 +11,7 @@ namespace MongoDB
/// Oid is an immutable object that represents a Mongo ObjectId.
/// </summary>
[Serializable]
public class Oid : IEquatable<Oid>, IComparable<Oid>, IFormattable, IXmlSerializable
public sealed class Oid : IEquatable<Oid>, IComparable<Oid>, IFormattable, IXmlSerializable
{
private static readonly OidGenerator OidGenerator = new OidGenerator();
private byte[] _bytes;
Expand All @@ -22,7 +22,7 @@ public class Oid : IEquatable<Oid>, IComparable<Oid>, IFormattable, IXmlSerializ
/// <remarks>
/// Needed for some serializers.
/// </remarks>
protected Oid()
private Oid()
{
}

Expand Down Expand Up @@ -255,7 +255,7 @@ public static Oid NewOid()
/// Validates the hex.
/// </summary>
/// <param name = "value">The value.</param>
protected void ValidateHex(string value)
private void ValidateHex(string value)
{
if(value == null || value.Length != 24)
throw new ArgumentException("Oid strings should be 24 characters");
Expand All @@ -270,7 +270,7 @@ protected void ValidateHex(string value)
/// </summary>
/// <param name = "value">The value.</param>
/// <returns></returns>
protected static byte[] DecodeHex(string value)
private static byte[] DecodeHex(string value)
{
var numberChars = value.Length;

Expand Down

0 comments on commit 91c4af4

Please sign in to comment.