/** * @param name Field name. * @return Field offset. */ private int fieldId(String name) { assert name != null; return mapper.fieldId(typeId, name); }
/** * @param typeId Type ID. * @param fieldName Field name. * @return Field ID. */ public int fieldId(int typeId, String fieldName) { BinaryInternalMapper mapper = userTypeMapper(typeId); return mapper.fieldId(typeId, fieldName); }
/** * @param typeId Type ID. * @param fieldName Field name. * @return Field ID. */ public int fieldId(int typeId, String fieldName) { int id = idMapper.fieldId(typeId, nameMapper.fieldName(fieldName)); if (!checkOnZeroId) return id; return id != 0 ? id : BinaryContext.SIMPLE_NAME_LOWER_CASE_MAPPER.fieldId(typeId, fieldName); }
/** * Create binary field. * * @param typeId Type ID. * @param fieldName Field name. * @return Binary field. */ public BinaryFieldImpl createField(int typeId, String fieldName) { BinarySchemaRegistry schemaReg = schemaRegistry(typeId); BinaryInternalMapper mapper = userTypeMapper(typeId); int fieldId = mapper.fieldId(typeId, fieldName); return new BinaryFieldImpl(this, typeId, schemaReg, fieldName, fieldId); }
/** * @param fieldName Field name. * @throws org.apache.ignite.binary.BinaryObjectException If fields are not allowed. */ private void writeFieldId(String fieldName) throws BinaryObjectException { A.notNull(fieldName, "fieldName"); if (rawOffPos != 0) throw new BinaryObjectException("Individual field can't be written after raw writer is acquired."); if (mapper == null) mapper = ctx.userTypeMapper(typeId); assert mapper != null; int id = mapper.fieldId(typeId, fieldName); writeFieldId(id); }
int fieldId = this.mapper.fieldId(typeId, name);
/** * @param name Field name. * @param mode Field mode. * @throws BinaryObjectException In case of error. */ private void add(String name, BinaryWriteMode mode) throws BinaryObjectException { assert name != null; int typeId = mode.typeId(); int fieldId = mapper.fieldId(typeId, name); BinaryFieldMetadata oldFieldMeta = meta.put(name, new BinaryFieldMetadata(typeId, fieldId)); if (oldFieldMeta != null && oldFieldMeta.typeId() != typeId) { throw new BinaryObjectException( "Field is written twice with different types [" + "typeName=" + typeName + ", fieldName=" + name + ", fieldTypeName1=" + BinaryUtils.fieldTypeName(oldFieldMeta.typeId()) + ", fieldTypeName2=" + BinaryUtils.fieldTypeName(typeId) + ']' ); } schemaBuilder.addField(fieldId); } }
/** * @param name Field name. * @return Field offset. */ private int fieldId(String name) { assert name != null; return mapper.fieldId(typeId, name); }
/** * @param typeId Type ID. * @param fieldName Field name. * @return Field ID. */ public int fieldId(int typeId, String fieldName) { BinaryInternalMapper mapper = userTypeMapper(typeId); return mapper.fieldId(typeId, fieldName); }
/** * @param typeId Type ID. * @param fieldName Field name. * @return Field ID. */ public int fieldId(int typeId, String fieldName) { int id = idMapper.fieldId(typeId, nameMapper.fieldName(fieldName)); if (!checkOnZeroId) return id; return id != 0 ? id : BinaryContext.SIMPLE_NAME_LOWER_CASE_MAPPER.fieldId(typeId, fieldName); }
/** * Create binary field. * * @param typeId Type ID. * @param fieldName Field name. * @return Binary field. */ public BinaryFieldImpl createField(int typeId, String fieldName) { BinarySchemaRegistry schemaReg = schemaRegistry(typeId); BinaryInternalMapper mapper = userTypeMapper(typeId); int fieldId = mapper.fieldId(typeId, fieldName); return new BinaryFieldImpl(this, typeId, schemaReg, fieldName, fieldId); }
/** * @param fieldName Field name. * @throws org.apache.ignite.binary.BinaryObjectException If fields are not allowed. */ private void writeFieldId(String fieldName) throws BinaryObjectException { A.notNull(fieldName, "fieldName"); if (rawOffPos != 0) throw new BinaryObjectException("Individual field can't be written after raw writer is acquired."); if (mapper == null) mapper = ctx.userTypeMapper(typeId); assert mapper != null; int id = mapper.fieldId(typeId, fieldName); writeFieldId(id); }
int fieldId = this.mapper.fieldId(typeId, name);
/** * @param name Field name. * @param mode Field mode. * @throws BinaryObjectException In case of error. */ private void add(String name, BinaryWriteMode mode) throws BinaryObjectException { assert name != null; int typeId = mode.typeId(); int fieldId = mapper.fieldId(typeId, name); BinaryFieldMetadata oldFieldMeta = meta.put(name, new BinaryFieldMetadata(typeId, fieldId)); if (oldFieldMeta != null && oldFieldMeta.typeId() != typeId) { throw new BinaryObjectException( "Field is written twice with different types [" + "typeName=" + typeName + ", fieldName=" + name + ", fieldTypeName1=" + BinaryUtils.fieldTypeName(oldFieldMeta.typeId()) + ", fieldTypeName2=" + BinaryUtils.fieldTypeName(typeId) + ']' ); } schemaBuilder.addField(fieldId); } }