/** * Get relative field offset. * * @param obj Object. * @return Field offset. */ public int fieldOrder(BinaryObjectExImpl obj) { if (typeId != obj.typeId()) { throw new BinaryObjectException("Failed to get field because type ID of passed object differs" + " from type ID this " + BinaryField.class.getSimpleName() + " belongs to [expected=" + typeId + ", actual=" + obj.typeId() + ']'); } int schemaId = obj.schemaId(); if (schemaId == 0) return BinarySchema.ORDER_NOT_FOUND; BinarySchema schema = schemas.schema(schemaId); if (schema == null) { schema = obj.createSchema(); schemas.addSchema(schemaId, schema); } assert schema != null; return schema.order(fieldId); }
/** * Get relative field offset. * * @param obj Object. * @return Field offset. */ public int fieldOrder(BinaryObjectExImpl obj) { if (typeId != obj.typeId()) { throw new BinaryObjectException("Failed to get field because type ID of passed object differs" + " from type ID this " + BinaryField.class.getSimpleName() + " belongs to [expected=" + typeId + ", actual=" + obj.typeId() + ']'); } int schemaId = obj.schemaId(); if (schemaId == 0) return BinarySchema.ORDER_NOT_FOUND; BinarySchema schema = schemas.schema(schemaId); if (schema == null) { schema = obj.createSchema(); schemas.addSchema(schemaId, schema); } assert schema != null; return schema.order(fieldId); }