Interface RecordSerializable
- All Superinterfaces:
JsonSerializable
- All Known Subinterfaces:
Encoder<S,,T> FileSink,FileSource,IFieldMapping
- All Known Implementing Classes:
AbstractFieldMapping,AbstractPipeline,AddFieldsAction,AggregateGroupFieldsAction,AmazonS3File,AmazonS3FileSink,AmazonS3FileSource,Attributes,AvroPipelineInput,AvroPipelineOutput,Bean,BinaryFieldDef,BloombergMessage,BooleanFieldDef,CalculatedField,Column,CompositePipelineAction,ConcurrentRecordList,ConvertDateTimeToStringAction,ConvertNullToValueAction,ConvertNumberToStringAction,ConvertStringToBooleanAction,ConvertStringToDateTimeAction,ConvertStringToNumberAction,ConvertValueToStringAction,CopyFieldsAction,CsvPipelineInput,CsvPipelineOutput,DataMapping,DataMappingAction,DataMappingObject,DataMappingPart,DataMappingPipeline,DataMappingProblem,DataMappingResult,DataReaderPipelineInput,Dataset,DatasetPipelineInput,DataWriterPipelineOutput,DateTimePattern,DateTimePatternMatch,DecisionTable,DecisionTableAction,DecisionTableCondition,DecisionTableObject,DecisionTableOutcome,DecisionTableResult,DecisionTableRule,DecisionTree,DecisionTreeAction,DecisionTreeNode,DecisionTreeObject,DecisionTreeOutcome,DecisionTreeResult,Diff,Encoder.HexEncoder,Encoder.NullEncoder,EntityDef,EntityDefDiff,EntityRelationshipDef,EntityRelationshipDefDiff,ExcelPipelineInput,ExcelPipelineOutput,FieldDef,FieldDefDiff,FieldMapping,FieldPath,FileSinkPipelineOutput,FileSourcePipelineInput,FilterFieldExistsAction,FilterFieldMatchesPatternAction,FilterFieldNotNullAction,FilterMatchExpression,FixedWidthField,FixedWidthPipelineInput,FixedWidthPipelineOutput,FoundationObject,IndexDef,IndexDefDiff,IndexFieldDef,IndexFieldDefDiff,JdbcConnection,JdbcDataset,JdbcExportedKey,JdbcFieldIndex,JdbcImportedKey,JdbcIndex,JdbcPipelineInput,JdbcPipelineOutput,JdbcQuery,JdbcQueryColumn,JdbcQueryParameter,JdbcSchema,JdbcTable,JdbcTableColumn,JiraIssue,JiraSearch,JsonPipelineInput,JsonRecordPipelineInput,JsonRecordPipelineOutput,LatexPipelineOutput,LocalFile,LocalFileDataset,LocalFileSink,LocalFileSource,MemoryDataset,MicrosoftWordPipelineOutput,MvStoreDataset,NullPipeline,NumberDescriptor,NumberMatch,NumericFieldDef,OpenFinancialExchangePipelineInput,OrcPipelineInput,OrcPipelineOutput,ParquetPipelineInput,ParquetPipelineOutput,PdfPipelineInput,PdfPipelineOutput,Pipeline,PipelineAction,PipelineInput,PipelineObject,PipelineOutput,Property,PropertyDiff,ProxyFileSource,ProxyPipelineInput,ProxyPipelineOutput,RecordDiff,RecordFieldDef,RecordList,RemoveDuplicatesAction,RenameFieldsAction,SchemaDef,SchemaDefDiff,SchemaObject,SchemaPart,SchemaProblem,SchemaValidationPath,SelectArrangeFieldsAction,ShopifyCustomerCriteria,ShopifyEventCriteria,ShopifyInventoryItem,ShopifyInventoryItemCriteria,ShopifyInventoryLevelCriteria,ShopifyOrder,ShopifyProductCriteria,ShopifyShippingAddress,SortFieldsAction,Tags,TemporalFieldDef,TextFieldDef,Tree,TreeNode,UuidFieldDef,ValidateFieldsExistsAction,ValidateFieldsMatchPatternAction,ValidateFieldsNotNullAction,ValidateMatchExpression,ValidationMessage,ValidationResult,XmlField,XmlPipelineInput,XmlRecordPipelineInput,XmlRecordPipelineOutput
The interface implemented by classes to participate in serialization to and from Record.
Implementing this interface automatically provide serialization to and from JSON via Record's features.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends Collection<String>>
CfromArrayValue(Record source, String arrayValueFieldName, C collection) Clears the collection and adds the string form of each element in the named array field.static <T extends RecordSerializable,C extends Collection<T>>
CfromArrayValue(Record source, String arrayValueFieldName, Class<T> componentType, C collection) Clears the collection and adds onecomponentTypeobject, created with its no-arg constructor, per record in the named array field.static <T extends RecordSerializable,C extends Collection<T>>
CfromArrayValue(Record source, String arrayValueFieldName, Class<T> componentType, C collection, boolean useNewInstanceFromRecord) Clears the collection and adds one object per record in the named array field;useNewInstanceFromRecordcreates each from itsSERIALIZED_CLASS_NAMEfield instead ofcomponentType's no-arg constructor.default JsonSerializablefromJson(InputStream inputStream) Loads this object's state from the UTF-8 encoded JSON in the stream.default JsonSerializableLoads this object's state from the given JSON text.fromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).static <T extends RecordSerializable>
TnewInstanceFromRecord(Record source) Instantiates the class named in the record'sSERIALIZED_CLASS_NAMEfield (via its no-arg constructor) and loads it from the record; returns null for a null record.static <T extends RecordSerializable>
TnewInstanceFromRecord(Record source, Class<? super T> type) Instantiates the class named in the record'sSERIALIZED_CLASS_NAMEfield and loads it from the record; the class must be assignable totypewhen it is not null.static <T extends RecordSerializable>
ArrayValuetoArrayValue(Collection<T> collection) Returns an array holding each object'stoRecord()record; empty if the collection is null or empty.default StringtoJson()default RecordSerializableWrites this object as JSON to the writer, then closes the writer.default RecordSerializableWrites this object as JSON to the writer, closing the writer afterwards ifcloseWriteris true.toRecord()Converts this object's state to a record thatfromRecord(Record)can load.static RecordtoRecord(RecordSerializable source) Converts the object to a record that also names its class in theSERIALIZED_CLASS_NAMEfield, sonewInstanceFromRecord(Record)can recreate it; returns null for a null object.
-
Field Details
-
SERIALIZED_CLASS_NAME
- See Also:
-
TYPE
-
-
Method Details
-
toRecord
Record toRecord()Converts this object's state to a record thatfromRecord(Record)can load. -
fromRecord
Loads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Parameters:
source-- Returns:
- this instance.
-
toRecord
Converts the object to a record that also names its class in theSERIALIZED_CLASS_NAMEfield, sonewInstanceFromRecord(Record)can recreate it; returns null for a null object. -
newInstanceFromRecord
Instantiates the class named in the record'sSERIALIZED_CLASS_NAMEfield (via its no-arg constructor) and loads it from the record; returns null for a null record. -
newInstanceFromRecord
Instantiates the class named in the record'sSERIALIZED_CLASS_NAMEfield and loads it from the record; the class must be assignable totypewhen it is not null. Returns null for a null record. -
toJson
- Specified by:
toJsonin interfaceJsonSerializable
-
toJson
Description copied from interface:JsonSerializableWrites this object as JSON to the writer, then closes the writer.- Specified by:
toJsonin interfaceJsonSerializable
-
toJson
Description copied from interface:JsonSerializableWrites this object as JSON to the writer, closing the writer afterwards ifcloseWriteris true.- Specified by:
toJsonin interfaceJsonSerializable
-
fromJson
Description copied from interface:JsonSerializableLoads this object's state from the given JSON text.- Specified by:
fromJsonin interfaceJsonSerializable
-
fromJson
Description copied from interface:JsonSerializableLoads this object's state from the UTF-8 encoded JSON in the stream.- Specified by:
fromJsonin interfaceJsonSerializable
-
toArrayValue
Returns an array holding each object'stoRecord()record; empty if the collection is null or empty. -
fromArrayValue
static <T extends RecordSerializable,C extends Collection<T>> C fromArrayValue(Record source, String arrayValueFieldName, Class<T> componentType, C collection, boolean useNewInstanceFromRecord) Clears the collection and adds one object per record in the named array field;useNewInstanceFromRecordcreates each from itsSERIALIZED_CLASS_NAMEfield instead ofcomponentType's no-arg constructor. -
fromArrayValue
static <T extends RecordSerializable,C extends Collection<T>> C fromArrayValue(Record source, String arrayValueFieldName, Class<T> componentType, C collection) Clears the collection and adds onecomponentTypeobject, created with its no-arg constructor, per record in the named array field. -
fromArrayValue
static <C extends Collection<String>> C fromArrayValue(Record source, String arrayValueFieldName, C collection) Clears the collection and adds the string form of each element in the named array field.
-