Overview | Package | Class | Tree | Deprecated | Index | Help
| SMILA API documentation
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.smila.datamodel
Interface DataFactory

All Known Implementing Classes:
  DefaultDataFactoryImpl

    public interface DataFactory

Interface for creation of data objects.

Author:
  cind01

Field Summary
`static DataFactory` | `DEFAULT` default instance.

Method Summary
`Value` | `autoConvertValue(java.lang.Object object)` auto converts the given object into the object's corresponding Value.
`Any` | `cloneAny(Any source)` Clone Any object.
`AnyMap` | `cloneAnyMap(AnyMap source)` Clone AnyMap object.
`AnySeq` | `cloneAnySeq(AnySeq source)` Clone AnySeq object.
`Record` | `cloneRecord(Record record, java.lang.String newId)` create clone of record with new Id.
`AnyMap` | `createAnyMap()`
`AnySeq` | `createAnySeq()`
`Value` | `createBooleanValue(java.lang.Boolean value)`
`Value` | `createDateTimeValue(java.util.Date value)`
`Value` | `createDateValue(java.util.Date value)`
`Value` | `createDoubleValue(java.lang.Double value)`
`Value` | `createDoubleValue(float value)`
`Value` | `createLongValue(int value)`
`Value` | `createLongValue(java.lang.Long value)`
`Record` | `createRecord()` create a new Record.
`Record` | `createRecord(java.lang.String id)` create a new Record.
`Record` | `createRecord(java.lang.String id, java.lang.String source)` create a new Record.
`Value` | `createStringValue(java.lang.String value)`
`Value` | `parseFromObject(java.lang.Object object)` Deprecated. Use `autoConvertValue(Object)` instead
`Value` | `parseFromString(java.lang.String value, Any.ValueType valueType)`
`Value` | `parseFromString(java.lang.String value, java.lang.String type)`
`Value` | `tryDateTimestampParsingFromString(java.lang.String value)` Tries to convert the String to a Date or Timestamp Value, if not possible return a String Value.

Field Detail

### DEFAULT

    static final DataFactory DEFAULT

  default instance.

Method Detail

### createRecord

    Record createRecord()

  create a new Record.

  Returns:
    new record.

### createRecord

    Record createRecord(java.lang.String id)

  create a new Record.

  Parameters:
    `id` - record id
  Returns:
    new record.

### createRecord

    Record createRecord(java.lang.String id,
                        java.lang.String source)

  create a new Record.

  Parameters:
    `id` - record id
    `source` - record data source
  Returns:
    new record.

### createAnyMap

    AnyMap createAnyMap()

  Returns:
    The created AnyMap object

### createAnySeq

    AnySeq createAnySeq()

  Returns:
    The created AnySeq object

### createStringValue

    Value createStringValue(java.lang.String value)

  Parameters:
    `value` - the String to create the Value from.
  Returns:
    The created Value object.

### createBooleanValue

    Value createBooleanValue(java.lang.Boolean value)

  Parameters:
    `value` - the Boolean to create the Value from.
  Returns:
    The created Value object.

### createLongValue

    Value createLongValue(java.lang.Long value)

  Parameters:
    `value` - the Long to create the Value from.
  Returns:
    The created Value object.

### createLongValue

    Value createLongValue(int value)

  Parameters:
    `value` - the int to create the Value from.
  Returns:
    The created Value object.

### createDoubleValue

    Value createDoubleValue(java.lang.Double value)

  Parameters:
    `value` - the Double to create the Value from.
  Returns:
    The created Value object.

### createDoubleValue

    Value createDoubleValue(float value)

  Parameters:
    `value` - the float to create the Value from.
  Returns:
    The created Value object.

### createDateValue

    Value createDateValue(java.util.Date value)

  Parameters:
    `value` - the Date to create the Value from.
  Returns:
    The created Value object.

### createDateTimeValue

    Value createDateTimeValue(java.util.Date value)

  Parameters:
    `value` - the DateTime to create the Value from.
  Returns:
    The created Value object.

### parseFromString

    Value parseFromString(java.lang.String value,
                          java.lang.String type)

  Parameters:
    `value` - The value
    `type` - The type
  Returns:
    The Value object with correct type, InvalidvalueTypeException else.

### parseFromString

    Value parseFromString(java.lang.String value,
                          Any.ValueType valueType)

  Parameters:
    `value` - The value
    `valueType` - The value's type
  Returns:
    The Value object with correct type, InvalidvalueTypeException else.

### tryDateTimestampParsingFromString

    Value tryDateTimestampParsingFromString(java.lang.String value)

  Tries to convert the String to a Date or Timestamp Value, if not possible return a String Value.

  Parameters:
    `value` - The value to check for Date/Timestamp
  Returns:
    The Value object with guessed type, InvalidvalueTypeException if value is null.

### parseFromObject

    @Deprecated
    Value parseFromObject(java.lang.Object object)

  Deprecated. Use `autoConvertValue(Object)` instead

  Parameters:
    `object` - The object
  Returns:
    The value matching the class of given object, InvalidValueTypeException otherwise.

### autoConvertValue

    Value autoConvertValue(java.lang.Object object)

  auto converts the given object into the object's corresponding Value.

  Parameters:
    `object` - The object, must be one of the simple types
  Returns:
    The value matching the class of given object, InvalidValueTypeException otherwise.

### cloneAny

    Any cloneAny(Any source)

  Clone Any object.

  Parameters:
    `source` - the source
  Returns:
    the attribute

### cloneAnyMap

    AnyMap cloneAnyMap(AnyMap source)

  Clone AnyMap object.

  Parameters:
    `source` - the source
  Returns:
    the attribute

### cloneAnySeq

    AnySeq cloneAnySeq(AnySeq source)

  Clone AnySeq object.

  Parameters:
    `source` - the source
  Returns:
    the attribute

### cloneRecord

    Record cloneRecord(Record record,
                       java.lang.String newId)

  create clone of record with new Id.

  Parameters:
    `record` - a record
    `newId` - new Id
  Returns:
    clone of record.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SMILA API documentation
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD