com.amazonaws.mobileconnectors.cognito
Class Record.Builder

java.lang.Object
  extended by com.amazonaws.mobileconnectors.cognito.Record.Builder
Enclosing class:
Record

public static final class Record.Builder
extends java.lang.Object

A Builder class that helps build an immutable Record object.


Constructor Summary
Record.Builder(java.lang.String key)
          Construct a builder object for the new Record with given key.
 
Method Summary
 Record build()
          Builds a new Record.
 Record.Builder deviceLastModifiedDate(java.util.Date deviceLastModifiedDate)
          Sets the device last modified date of this Record.
 Record.Builder lastModifiedBy(java.lang.String lastModifiedBy)
          Sets the last modified by of this Record.
 Record.Builder lastModifiedDate(java.util.Date lastModifiedDate)
          Sets the last modified date of this Record.
 Record.Builder modified(boolean modified)
          Sets whether this Record has local modification.
 Record.Builder syncCount(long syncCount)
          Sets the syncCount of the new Record.
 Record.Builder value(java.lang.String value)
          Sets the value of the new Record.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Record.Builder

public Record.Builder(java.lang.String key)
Construct a builder object for the new Record with given key.

Parameters:
key - Non empty String key of the record
Method Detail

value

public Record.Builder value(java.lang.String value)
Sets the value of the new Record. Default is null, aka deleted record.

Parameters:
value - nullable String value of this record
Returns:
builder itself

syncCount

public Record.Builder syncCount(long syncCount)
Sets the syncCount of the new Record. Default is the current time.

Parameters:
syncCount - non negative long value
Returns:
builder itself

lastModifiedDate

public Record.Builder lastModifiedDate(java.util.Date lastModifiedDate)
Sets the last modified date of this Record. Default is the current time.

Parameters:
lastModifiedDate - last modified date of this record
Returns:
builder itself

lastModifiedBy

public Record.Builder lastModifiedBy(java.lang.String lastModifiedBy)
Sets the last modified by of this Record. Default is empty string.

Parameters:
lastModifiedBy - device name or user name that last modified this record.
Returns:
builder itself

deviceLastModifiedDate

public Record.Builder deviceLastModifiedDate(java.util.Date deviceLastModifiedDate)
Sets the device last modified date of this Record. It's the local date of the device that modified this record. Default is the current date.

Parameters:
deviceLastModifiedDate - device last modified date
Returns:
builder itself

modified

public Record.Builder modified(boolean modified)
Sets whether this Record has local modification.

Parameters:
modified - a flag that indicates whether the record has local modification
Returns:
builder itself

build

public Record build()
Builds a new Record.

Returns:
a new Record object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.