Пример #1
0
 private void CheckFactoryAndClass(IFieldDefinition fd, int factoryId, int classId)
 {
     if (factoryId != fd.GetFactoryId())
     {
         throw new ArgumentException("Invalid factoryId! Expected: " + fd.GetFactoryId() + ", Current: " + factoryId);
     }
     if (classId != fd.GetClassId())
     {
         throw new ArgumentException("Invalid classId! Expected: " + fd.GetClassId() + ", Current: " + classId);
     }
 }
 private void CheckPortableAttributes(IFieldDefinition fd, IPortable portable)
 {
     if (fd.GetFactoryId() != portable.GetFactoryId())
     {
         throw new HazelcastSerializationException(
                   "Wrong Portable type! Generic portable types are not supported! " + " Expected factory-id: " +
                   fd.GetFactoryId() + ", Actual factory-id: " + portable.GetFactoryId());
     }
     if (fd.GetClassId() != portable.GetClassId())
     {
         throw new HazelcastSerializationException(
                   "Wrong Portable type! Generic portable types are not supported! " + "Expected class-id: " +
                   fd.GetClassId() + ", Actual class-id: " + portable.GetClassId());
     }
 }
        public virtual int GetFieldClassId(string fieldName)
        {
            IFieldDefinition fd = GetField(fieldName);

            if (fd != null)
            {
                return(fd.GetClassId());
            }
            throw new ArgumentException("Unknown field: " + fieldName);
        }
 private void CheckPortableAttributes(IFieldDefinition fd, IPortable portable)
 {
     if (fd.GetFactoryId() != portable.GetFactoryId())
     {
         throw new HazelcastSerializationException(
             "Wrong Portable type! Generic portable types are not supported! " + " Expected factory-id: " +
             fd.GetFactoryId() + ", Actual factory-id: " + portable.GetFactoryId());
     }
     if (fd.GetClassId() != portable.GetClassId())
     {
         throw new HazelcastSerializationException(
             "Wrong Portable type! Generic portable types are not supported! " + "Expected class-id: " +
             fd.GetClassId() + ", Actual class-id: " + portable.GetClassId());
     }
 }