import StringEncodable from '../util/StringEncodable'; import StringBuilder from '../util/java/StringBuilder'; import ClassicEncodingSettings from './encoding/ClassicEncodingSettings'; import JObject from '../util/java/JObject'; import FieldFormat from './FieldFormat'; import DataTable from './DataTable'; import QueryCondition from './QueryCondition'; import Data from '../data/Data'; import TableFormat from './TableFormat'; import JSBI from 'jsbi'; export default class DataRecord extends JObject implements StringEncodable { private static readonly ELEMENT_ID; private data; private format; private table; private id; constructor(tableFormat: TableFormat | null); /** * Constructs a DataRecord with specified TableFormat and fills it with data field-by-field. */ static createAndFill(tableFormat: TableFormat, ...data: Array): DataRecord; static createWithData(tableFormat: TableFormat, dataString: string, settings: ClassicEncodingSettings, validate: boolean, fieldNamesInData: Array | null): DataRecord; private setData; setId(id: string | null): DataRecord; /** * Adds new Boolean to the record. */ addBoolean(val: boolean | null): DataRecord; /** * Adds new Color to the record. */ /** * Adds new value to the record. */ addValue(value: any): DataRecord; /** * Adds new Data to the record. */ addData(val: Data): DataRecord; /** * Adds new DataTable to the record. */ addDataTable(val: DataTable | null): DataRecord; /** * Adds new Date to the record. */ addDate(val: Date): DataRecord; /** * Adds new Double to the record. */ addDouble(val: number): DataRecord; /** * Adds new String to the record. */ addString(val: string | null): DataRecord; /** * Adds new Float to the record. */ addFloat(val: number): DataRecord; /** * Sets value of field with specified index to value. */ setValueSmart(valueBy: number | string, value: JObject): DataRecord; toString(): string; /** * Sets value of field with specified index to value. */ setValue(nameOrIndex: number | string, value: any, validate?: boolean): DataRecord; clone(): DataRecord; cloneFormatFromTable(): void; dataAsString(showFieldNames: boolean, showHiddenFields: boolean, showPasswords?: boolean): string; valueAsString(name: string, showFieldNames: boolean, showHiddenFields: boolean, showPasswords: boolean): string; getTable(): DataTable | null; setTable(table: DataTable | null): void; private ensureMutable; private checkNumberOfDataFieldsSet; /** * Returns value of String field with specified name or index. */ getString(valueBy: number | string): string; getNullableString(valueBy: number | string): string | null; /** * Adds new Integer to the record. */ addInt(val: number): DataRecord; /** * Adds new Long to the record. */ addLong(val: number | null): DataRecord; /** * Returns value of Integer field with specified name or index. */ getInt(valueBy: number | string): number; getNullableInt(valueBy: number | string): number | null; /** * Returns value of Long field with specified index. */ getLong(valueBy: number | string): JSBI; getNullableLong(valueBy: number | string): JSBI | null; /** * Returns value of Boolean field with specified name or index. */ getBoolean(valueBy: number | string): boolean; getNullableBoolean(valueBy: number | string): boolean | null; getId(): string | null; getValue(searchBy: number | string): any; getValueAsString(searchBy: number | string): string | null; /** * Returns textual description of field value. The description is taken from selection values list specified in table format. */ getValueDescription(name: string): string | null; private getValueByFieldFormat; private isTableImmutable; encodeDataTable(useVisibleSeparators: boolean): string; getEncodedDataFromEncodingSettings(settings: ClassicEncodingSettings): string; encode(sb: StringBuilder, settings: ClassicEncodingSettings, isTransferEncode: boolean, encodeLevel: number): StringBuilder; /** * Returns true if record has field with specified name. */ hasField(name: string): boolean; /** * Returns true if record has field with specified name. */ meetToCondition(condition: QueryCondition): boolean; /** * Constructs new DataTable and adds this record to it. */ wrap(): DataTable; /** * Returns value of Data field with specified index or name. */ getData(valueBy: number | string): Data; getNullableData(valueBy: number | string): Data | null; /** * Returns value of DataTable field with specified index. */ getDataTable(valueBy: number | string): DataTable; getNullableDataTable(valueBy: number | string): DataTable | null; /** * Returns value of Date field with specified name. */ getDate(valueBy: number | string): Date; getNullableDate(valueBy: number | string): Date | null; /** * Returns value of Double field with specified index. */ getDouble(valueBy: number | string): number; getNullableDouble(valueBy: number | string): number | null; /** * Returns value of Float field with specified index. */ getFloat(valueBy: number | string): number; getNullableFloat(valueBy: number | string): number | null; /** * Returns format of the record. */ getFormat(): TableFormat; /** * Returns format of field with specified index. */ getFieldFormat(searchBy: number | string): FieldFormat; setFormat(format: TableFormat): void; /** * Returns index of field with specified name or throws an IllegalArgumentException if field is not found. */ private findIndex; /** * Returns number of fields in the record. */ getFieldCount(): number; equals(obj: any): boolean; }