Convert a record into a line by joining the fields together appropriately.
 This is pulled into a separate method so it can be called by the hooks.
343269
def join(details)
      joinchar = self.joiner

      fields.collect { |field|
        # If the field is marked absent, use the appropriate replacement
        if details[field] == :absent or details[field] == [:absent] or details[field].nil?
          if self.optional.include?(field)
            self.absent
          else
            raise ArgumentError, _("Field '%{field}' is required") % { field: field }
          end
        else
          details[field].to_s
        end
      }.reject { |c| c.nil?}.join(joinchar)
    end
309089
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
    { // Read a valid record
        int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption);      // Initialize the record
        if (iErrorCode == DBConstants.NORMAL_RETURN)
        {
            if (iChangeType == DBConstants.AFTER_ADD_TYPE)
            {
                Object bookmark = this.getOwner().getLastModified(m_iHandleType);
                if (bookmark != null)
                    this.addBookmarkFilter(bookmark);
            }
            if (iChangeType == DBConstants.AFTER_REQUERY_TYPE)
            {
                String strKeyName = null;
                Object objKeyData = null;
                if (this.getOwner().getDefaultOrder() > 0)
                {
                    strKeyName = this.getOwner().getKeyArea().getKeyName();
                    KeyField keyField = this.getOwner().getKeyArea().getKeyField(0);
                    BaseField fldKey = keyField.getField(DBConstants.FILE_KEY_AREA);
                    if (fldKey instanceof ReferenceField)
                    {
                        if (!keyField.getField(DBConstants.END_SELECT_KEY).isNull())
                            if (keyField.getField(DBConstants.END_SELECT_KEY).equals(keyField.getField(DBConstants.START_SELECT_KEY)))
                            {
                                fldKey = keyField.getField(DBConstants.START_SELECT_KEY);   // On a requery this should be the key
                                objKeyData = fldKey.getData();
                            }
                    }
                }
                this.clearBookmarkFilters(strKeyName, objKeyData);
            }
        }
        return iErrorCode;
    }
1244754
public Record moveRecordToBase(Record record)
    {
        SharedBaseRecordTable sharedTable = this.getSharedTable();
        sharedTable.setCurrentRecord(record);
        boolean bCopyEditMode = false;
        boolean bOnlyModifiedFields = false;
        Record recBase = sharedTable.getBaseRecord();
        sharedTable.copyRecordInfo(recBase, record, bCopyEditMode, bOnlyModifiedFields);
        return recBase;
    }
800100
function castRecordDateFields(record) {
  _.forEach(record, function (value, key) {
    if(_.isString(value) && iso.test(value)){
      record[key] = new Date(value);
    }
  });
}
301081
public void init(Record record, int iFieldSeq, String fieldName, int iSecondaryFieldSeq, String secondaryFieldName)
    {
        Converter converter = null;
        m_recMerge = record;
        m_iFieldSeq = iFieldSeq;
        m_iSecondaryFieldSeq = iSecondaryFieldSeq;
        this.fieldName = fieldName;
        this.secondaryFieldName = secondaryFieldName;
        if (record != null)
            converter = this.getTargetField(null);
        super.init(converter, null);
        if (record != null)
            record.addListener(new RemoveConverterOnCloseHandler(this));    // Because this is a converter (not a fieldConverter)
        if (m_recMerge != null)
            if (m_recMerge.getTable() instanceof MultiTable)
        {   // Add all the fields in the sub-records
            MultiTable multiTable = (MultiTable)m_recMerge.getTable();
            Iterator<BaseTable> iterator = multiTable.getTables();
            while (iterator.hasNext())
            {
                BaseTable table = (BaseTable)iterator.next();
                Converter field = this.getTargetField(table.getRecord());
                this.addConverterToPass(field);     // Add it, and
            }
        }
    }
1162594
def _process_line(self, line):
        
        fields = self._extract_fields(line)
        if not self._fields_valid(fields):
            self.log.warning("Missing required fields for line: {line}".format(
                line=line))

        metric_path_base = []
        graphite_prefix = fields.get('GRAPHITEPREFIX')
        graphite_postfix = fields.get('GRAPHITEPOSTFIX')

        if graphite_prefix:
            metric_path_base.append(graphite_prefix)

        hostname = fields['HOSTNAME'].lower()
        metric_path_base.append(hostname)

        datatype = fields['DATATYPE']
        if datatype == 'HOSTPERFDATA':
            metric_path_base.append('host')
        elif datatype == 'SERVICEPERFDATA':
            service_desc = fields.get('SERVICEDESC')
            graphite_postfix = fields.get('GRAPHITEPOSTFIX')
            if graphite_postfix:
                metric_path_base.append(graphite_postfix)
            else:
                metric_path_base.append(service_desc)

        perfdata = fields[datatype]
        counters = self._parse_perfdata(perfdata)

        for (counter, value) in counters:
            metric_path = metric_path_base + [counter]
            metric_path = [self._sanitize(x) for x in metric_path]
            metric_name = '.'.join(metric_path)
            self.publish(metric_name, value)
883355
public void write(Object[] record) throws IOException, DbaseFileException {

		if (record.length != header.getNumFields()) {
			throw new DbaseFileException("Wrong number of fields "
					+ record.length + " expected " + header.getNumFields());
		}

		buffer.position(0);

		// put the 'not-deleted' marker
		buffer.put((byte) ' ');

		for (int i = 0; i < header.getNumFields(); i++) {
			String fieldString = fieldString(record[i], i);
			if (header.getFieldLength(i) != fieldString
					.getBytes(charset.name()).length) {
				buffer.put(new byte[header.getFieldLength(i)]);
			} else {
				buffer.put(fieldString.getBytes(charset.name()));
			}

		}

		write();
	}
629673
function( cb ){
              if( ! self.positionField ){
                cb( null );
              } else {

                // If repositioning is required, do it
                if( self.positionField ){
                  var where, beforeId;
                  if( ! options.position ){
                    where = 'end';
                  } else {
                    where = options.position.where;
                    beforeId = options.position.beforeId;
                  }
                  self.reposition( recordWithLookups, where, beforeId, cb );
                }
              }
            }
1095413
function mapRecord (type, record) {
  const keys = this.keys
  const uriTemplate = this.uriTemplate
  const recordTypes = this.recordTypes
  const fields = recordTypes[type]
  const options = this.options
  const prefix = options.prefix
  const inflectType = options.inflectType
  const inflectKeys = options.inflectKeys
  const clone = {}

  const id = record[keys.primary]

  clone[reservedKeys.type] = inflectType[type] ?
    inflection.transform(type, typeInflections[1]) : type
  clone[reservedKeys.id] = id.toString()
  clone[reservedKeys.meta] = {}
  clone[reservedKeys.attributes] = {}
  clone[reservedKeys.relationships] = {}
  clone[reservedKeys.links] = {
    [reservedKeys.self]: prefix + uriTemplate.fillFromObject({
      type: inflectType[type] ?
        inflection.transform(type, typeInflections[1]) : type,
      ids: id
    })
  }

  const unionFields = union(Object.keys(fields), Object.keys(record))

  for (let i = 0, j = unionFields.length; i < j; i++) {
    let field = unionFields[i]

    if (field === keys.primary) continue

    const fieldDefinition = fields[field]
    const hasField = field in record

    if (!hasField && !fieldDefinition[keys.link]) continue

    const originalField = field

    // Per the recommendation, dasherize keys.
    if (inflectKeys)
      field = inflection.transform(field,
        [ 'underscore', 'dasherize' ])

    // Handle meta/attributes.
    if (!fieldDefinition || fieldDefinition[keys.type]) {
      const value = record[originalField]

      if (!fieldDefinition) clone[reservedKeys.meta][field] = value
      else clone[reservedKeys.attributes][field] = value

      continue
    }

    // Handle link fields.
    const ids = record[originalField]

    const linkedType = inflectType[fieldDefinition[keys.link]] ?
      inflection.transform(fieldDefinition[keys.link], typeInflections[1]) :
      fieldDefinition[keys.link]

    clone[reservedKeys.relationships][field] = {
      [reservedKeys.links]: {
        [reservedKeys.self]: prefix + uriTemplate.fillFromObject({
          type: inflectType[type] ?
            inflection.transform(type, typeInflections[1]) : type,
          ids: id,
          relatedField: reservedKeys.relationships,
          relationship: inflectKeys ? inflection.transform(field,
            [ 'underscore', 'dasherize' ]) : field
        }),
        [reservedKeys.related]: prefix + uriTemplate.fillFromObject({
          type: inflectType[type] ?
            inflection.transform(type, typeInflections[1]) : type,
          ids: id,
          relatedField: inflectKeys ? inflection.transform(field,
            [ 'underscore', 'dasherize' ]) : field
        })
      }
    }

    if (hasField)
      clone[reservedKeys.relationships][field][reservedKeys.primary] =
        fieldDefinition[keys.isArray] ?
          ids.map(toIdentifier.bind(null, linkedType)) :
          (ids ? toIdentifier(linkedType, ids) : null)
  }

  if (!Object.keys(clone[reservedKeys.attributes]).length)
    delete clone[reservedKeys.attributes]

  if (!Object.keys(clone[reservedKeys.meta]).length)
    delete clone[reservedKeys.meta]

  if (!Object.keys(clone[reservedKeys.relationships]).length)
    delete clone[reservedKeys.relationships]

  return clone
}
1011506
public void fieldsToData(Rec record) throws DBException
    {
        this.setupNewDataSource();
        int fieldCount = record.getFieldCount(); // Number of fields to write out
        for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq < fieldCount + Constants.MAIN_FIELD; iFieldSeq++)
        {
            Field field = record.getField(iFieldSeq);
            if (field.isVirtual()) //x || (!field.isSelected()))
                continue;               // This field is never moved to a buffer
            this.fieldToData(field);
        }
    }
927511
@Override
	public void writeRecord(Record record) throws IOException {
		int numRecFields = record.getNumFields();
		int readPos;

		for (int i = 0; i < this.numFields; i++) {
			readPos = this.recordPositions[i];
			if (readPos < numRecFields) {
				Value v = record.getField(this.recordPositions[i], this.classes[i]);
				if (v != null) {
					if (i != 0) {
						this.wrt.write(this.fieldDelimiter);
					}
					this.wrt.write(v.toString());
				} else {
					if (this.lenient) {
						if (i != 0) {
							this.wrt.write(this.fieldDelimiter);
						}
					} else {
						throw new RuntimeException("Cannot serialize record with <null> value at position: " + readPos);
					}
				}

			} else {
				if (this.lenient) {
					if (i != 0) {
						this.wrt.write(this.fieldDelimiter);
					}
				} else {
					throw new RuntimeException("Cannot serialize record with out field at position: " + readPos);
				}
			}

		}

		// add the record delimiter
		this.wrt.write(this.recordDelimiter);
	}
826044
public void init(Record record, String strLinkedRecord, int iFieldSeq)
    {
        super.init(null);
        m_MergeRecord = record;
        m_strLinkedRecord = strLinkedRecord;
        m_FieldSeq = iFieldSeq;
        if (record != null)
            record.addListener(new RemoveConverterOnCloseHandler(this));    // Because this is a converter (not a fieldConverter)
    }
1314590
def _combine_lines(self, lines):
        
        lines = filter(None, map(lambda x: x.strip(), lines))
        return '[' + ','.join(lines) + ']'
979751
@Override
	public String formatRecord(RepositoryLogRecord record, Locale locale) {
		if (null == record) {
			throw new IllegalArgumentException("Record cannot be null");
		}
		StringBuilder sb = new StringBuilder(300);
		String lineSeparatorPlusPadding = "";


		// Use basic format
		createEventHeader(record, sb);
		lineSeparatorPlusPadding = svLineSeparatorPlusBasicPadding;

		// add the localizedMsg
		sb.append(formatMessage(record, locale));

		// if we have a stack trace, append that to the formatted output.
		if (record.getStackTrace() != null) {
			sb.append(lineSeparatorPlusPadding);
			sb.append(record.getStackTrace());
		}
		return sb.toString();
	}
210342
def from_record(cls, record, crs):
        """"""
        if 'type' not in record:
            raise TypeError("The data isn't a valid record.")

        return cls(to_shape(record), crs)
944712
def concat(*records)
      load_target
      flatten_records = records.flatten
      flatten_records.each { |val| raise_on_type_mismatch!(val) }
      target_ids = reflection.options[:target_ids]
      owner[target_ids] ||= []
      owner[target_ids].concat(flatten_records.map(&:id))

      flatten_records.each do |record|
        if index = @target.index(record)
          @target[index] = record
        else
          @target << record
        end
      end

      target
    end
144847
private void doAppendLine(final String... fields) throws IOException {
		if (null != fields) {
			for (int i = 0; i < fields.length; i++) {
				appendField(fields[i]);
			}
			writer.write(config.lineDelimiter);
			newline = true;
		}
	}