This is an automated email from the ASF dual-hosted git repository. ptupitsyn pushed a commit to branch ignite-27278 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 214e00be4ac69dbea5efab572dd6eab9826ef974 Author: Pavel Tupitsyn <[email protected]> AuthorDate: Wed Dec 24 12:23:21 2025 +0200 Revert "wip BasicMappers" This reverts commit a7bd6c7d5a0354e116b44912ef59074d9e24d4d2. --- .../Apache.Ignite/Internal/Table/BasicMappers.cs | 67 ---------------------- 1 file changed, 67 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite/Internal/Table/BasicMappers.cs b/modules/platforms/dotnet/Apache.Ignite/Internal/Table/BasicMappers.cs deleted file mode 100644 index 80856a78baa..00000000000 --- a/modules/platforms/dotnet/Apache.Ignite/Internal/Table/BasicMappers.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Internal.Table; - -using System; -using Ignite.Table.Mapper; - -/// <summary> -/// Mappers for common key types. -/// <para /> -/// An optimization to avoid generating mappers via reflection for basic types. -/// </summary> -internal static class BasicMappers -{ - /// <summary> - /// Gets a mapper for a basic type if available, null otherwise. - /// </summary> - /// <typeparam name="T">Type.</typeparam> - /// <returns>Mapper or null.</returns> - internal static IMapper<T>? TryGet<T>() - { - if (typeof(T) == typeof(Guid)) - { - return (IMapper<T>)(object)GuidMapper.Instance; - } - - if (typeof(T) == typeof(string)) - { - return (IMapper<T>)(object)StringMapper.Instance; - } - - return null; - } - - private sealed class GuidMapper : IMapper<Guid> - { - public static readonly GuidMapper Instance = new(); - - public void Write(Guid obj, ref RowWriter rowWriter, IMapperSchema schema) => rowWriter.WriteGuid(obj); - - public Guid Read(ref RowReader rowReader, IMapperSchema schema) => rowReader.ReadGuid()!.Value; - } - - private sealed class StringMapper : IMapper<string> - { - public static readonly StringMapper Instance = new(); - - public void Write(string obj, ref RowWriter rowWriter, IMapperSchema schema) => rowWriter.WriteString(obj); - - public string Read(ref RowReader rowReader, IMapperSchema schema) => rowReader.ReadString()!; - } -}
