Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.cognitosync.model;
 

Returned for a successful ListRecordsRequest.

 
 public class ListRecordsResult implements SerializableCloneable {

    
A list of all records.
 
A pagination token for obtaining the next page of results.
 
     private String nextToken;

    
Total number of records.
 
     private Integer count;

    
Server sync count for this dataset.
 
     private Long datasetSyncCount;

    
The user/device that made the last change to this record.
 
     private String lastModifiedBy;

    
Names of merged datasets.
 
Indicates whether the dataset exists.
 
     private Boolean datasetExists;

    
A boolean value specifying whether to delete the dataset locally.
 
A token containing a session ID, identity ID, and expiration.
 
     private String syncSessionToken;

    
A list of all records.

Returns:
A list of all records.
 
     public java.util.List<RecordgetRecords() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Record>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of all records.

Parameters:
records A list of all records.
 
     public void setRecords(java.util.Collection<Recordrecords) {
         if (records == null) {
             this. = null;
             return;
         }
         recordsCopy.addAll(records);
         this. = recordsCopy;
     }
    
    
A list of all records.

NOTE: This method appends the values to the existing list (if any). Use setRecords(java.util.Collection) or withRecords(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
records A list of all records.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withRecords(Record... records) {
        if (getRecords() == nullsetRecords(new java.util.ArrayList<Record>(records.length));
        for (Record value : records) {
            getRecords().add(value);
        }
        return this;
    }
    
    
A list of all records.

Returns a reference to this object so that method calls can be chained together.

Parameters:
records A list of all records.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (records == null) {
            this. = null;
        } else {
            recordsCopy.addAll(records);
            this. = recordsCopy;
        }
        return this;
    }

    
A pagination token for obtaining the next page of results.

Returns:
A pagination token for obtaining the next page of results.
    public String getNextToken() {
        return ;
    }
    
    
A pagination token for obtaining the next page of results.

Parameters:
nextToken A pagination token for obtaining the next page of results.
    public void setNextToken(String nextToken) {
        this. = nextToken;
    }
    
    
A pagination token for obtaining the next page of results.

Returns a reference to this object so that method calls can be chained together.

Parameters:
nextToken A pagination token for obtaining the next page of results.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withNextToken(String nextToken) {
        this. = nextToken;
        return this;
    }

    
Total number of records.

Returns:
Total number of records.
    public Integer getCount() {
        return ;
    }
    
    
Total number of records.

Parameters:
count Total number of records.
    public void setCount(Integer count) {
        this. = count;
    }
    
    
Total number of records.

Returns a reference to this object so that method calls can be chained together.

Parameters:
count Total number of records.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withCount(Integer count) {
        this. = count;
        return this;
    }

    
Server sync count for this dataset.

Returns:
Server sync count for this dataset.
    public Long getDatasetSyncCount() {
        return ;
    }
    
    
Server sync count for this dataset.

Parameters:
datasetSyncCount Server sync count for this dataset.
    public void setDatasetSyncCount(Long datasetSyncCount) {
        this. = datasetSyncCount;
    }
    
    
Server sync count for this dataset.

Returns a reference to this object so that method calls can be chained together.

Parameters:
datasetSyncCount Server sync count for this dataset.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withDatasetSyncCount(Long datasetSyncCount) {
        this. = datasetSyncCount;
        return this;
    }

    
The user/device that made the last change to this record.

Returns:
The user/device that made the last change to this record.
    public String getLastModifiedBy() {
        return ;
    }
    
    
The user/device that made the last change to this record.

Parameters:
lastModifiedBy The user/device that made the last change to this record.
    public void setLastModifiedBy(String lastModifiedBy) {
        this. = lastModifiedBy;
    }
    
    
The user/device that made the last change to this record.

Returns a reference to this object so that method calls can be chained together.

Parameters:
lastModifiedBy The user/device that made the last change to this record.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withLastModifiedBy(String lastModifiedBy) {
        this. = lastModifiedBy;
        return this;
    }

    
Names of merged datasets.

Returns:
Names of merged datasets.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Names of merged datasets.

Parameters:
mergedDatasetNames Names of merged datasets.
    public void setMergedDatasetNames(java.util.Collection<StringmergedDatasetNames) {
        if (mergedDatasetNames == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringmergedDatasetNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(mergedDatasetNames.size());
        mergedDatasetNamesCopy.addAll(mergedDatasetNames);
        this. = mergedDatasetNamesCopy;
    }
    
    
Names of merged datasets.

NOTE: This method appends the values to the existing list (if any). Use setMergedDatasetNames(java.util.Collection) or withMergedDatasetNames(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
mergedDatasetNames Names of merged datasets.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withMergedDatasetNames(String... mergedDatasetNames) {
        if (getMergedDatasetNames() == nullsetMergedDatasetNames(new java.util.ArrayList<String>(mergedDatasetNames.length));
        for (String value : mergedDatasetNames) {
            getMergedDatasetNames().add(value);
        }
        return this;
    }
    
    
Names of merged datasets.

Returns a reference to this object so that method calls can be chained together.

Parameters:
mergedDatasetNames Names of merged datasets.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withMergedDatasetNames(java.util.Collection<StringmergedDatasetNames) {
        if (mergedDatasetNames == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringmergedDatasetNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(mergedDatasetNames.size());
            mergedDatasetNamesCopy.addAll(mergedDatasetNames);
            this. = mergedDatasetNamesCopy;
        }
        return this;
    }

    
Indicates whether the dataset exists.

Returns:
Indicates whether the dataset exists.
    public Boolean isDatasetExists() {
        return ;
    }
    
    
Indicates whether the dataset exists.

Parameters:
datasetExists Indicates whether the dataset exists.
    public void setDatasetExists(Boolean datasetExists) {
        this. = datasetExists;
    }
    
    
Indicates whether the dataset exists.

Returns a reference to this object so that method calls can be chained together.

Parameters:
datasetExists Indicates whether the dataset exists.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withDatasetExists(Boolean datasetExists) {
        this. = datasetExists;
        return this;
    }

    
Indicates whether the dataset exists.

Returns:
Indicates whether the dataset exists.
    public Boolean getDatasetExists() {
        return ;
    }

    
A boolean value specifying whether to delete the dataset locally.

Returns:
A boolean value specifying whether to delete the dataset locally.
    }
    
    
A boolean value specifying whether to delete the dataset locally.

Parameters:
datasetDeletedAfterRequestedSyncCount A boolean value specifying whether to delete the dataset locally.
    public void setDatasetDeletedAfterRequestedSyncCount(Boolean datasetDeletedAfterRequestedSyncCount) {
        this. = datasetDeletedAfterRequestedSyncCount;
    }
    
    
A boolean value specifying whether to delete the dataset locally.

Returns a reference to this object so that method calls can be chained together.

Parameters:
datasetDeletedAfterRequestedSyncCount A boolean value specifying whether to delete the dataset locally.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withDatasetDeletedAfterRequestedSyncCount(Boolean datasetDeletedAfterRequestedSyncCount) {
        this. = datasetDeletedAfterRequestedSyncCount;
        return this;
    }

    
A boolean value specifying whether to delete the dataset locally.

Returns:
A boolean value specifying whether to delete the dataset locally.
    }

    
A token containing a session ID, identity ID, and expiration.

Returns:
A token containing a session ID, identity ID, and expiration.
    public String getSyncSessionToken() {
        return ;
    }
    
    
A token containing a session ID, identity ID, and expiration.

Parameters:
syncSessionToken A token containing a session ID, identity ID, and expiration.
    public void setSyncSessionToken(String syncSessionToken) {
        this. = syncSessionToken;
    }
    
    
A token containing a session ID, identity ID, and expiration.

Returns a reference to this object so that method calls can be chained together.

Parameters:
syncSessionToken A token containing a session ID, identity ID, and expiration.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListRecordsResult withSyncSessionToken(String syncSessionToken) {
        this. = syncSessionToken;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getRecords() != nullsb.append("Records: " + getRecords() + ",");
        if (getNextToken() != nullsb.append("NextToken: " + getNextToken() + ",");
        if (getCount() != nullsb.append("Count: " + getCount() + ",");
        if (getDatasetSyncCount() != nullsb.append("DatasetSyncCount: " + getDatasetSyncCount() + ",");
        if (getLastModifiedBy() != nullsb.append("LastModifiedBy: " + getLastModifiedBy() + ",");
        if (getMergedDatasetNames() != nullsb.append("MergedDatasetNames: " + getMergedDatasetNames() + ",");
        if (isDatasetExists() != nullsb.append("DatasetExists: " + isDatasetExists() + ",");
        if (isDatasetDeletedAfterRequestedSyncCount() != nullsb.append("DatasetDeletedAfterRequestedSyncCount: " + isDatasetDeletedAfterRequestedSyncCount() + ",");
        if (getSyncSessionToken() != nullsb.append("SyncSessionToken: " + getSyncSessionToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getRecords() == null) ? 0 : getRecords().hashCode()); 
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); 
        hashCode = prime * hashCode + ((getCount() == null) ? 0 : getCount().hashCode()); 
        hashCode = prime * hashCode + ((getDatasetSyncCount() == null) ? 0 : getDatasetSyncCount().hashCode()); 
        hashCode = prime * hashCode + ((getLastModifiedBy() == null) ? 0 : getLastModifiedBy().hashCode()); 
        hashCode = prime * hashCode + ((getMergedDatasetNames() == null) ? 0 : getMergedDatasetNames().hashCode()); 
        hashCode = prime * hashCode + ((isDatasetExists() == null) ? 0 : isDatasetExists().hashCode()); 
        hashCode = prime * hashCode + ((isDatasetDeletedAfterRequestedSyncCount() == null) ? 0 : isDatasetDeletedAfterRequestedSyncCount().hashCode()); 
        hashCode = prime * hashCode + ((getSyncSessionToken() == null) ? 0 : getSyncSessionToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ListRecordsResult == falsereturn false;
        ListRecordsResult other = (ListRecordsResult)obj;
        
        if (other.getRecords() == null ^ this.getRecords() == nullreturn false;
        if (other.getRecords() != null && other.getRecords().equals(this.getRecords()) == falsereturn false
        if (other.getNextToken() == null ^ this.getNextToken() == nullreturn false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == falsereturn false
        if (other.getCount() == null ^ this.getCount() == nullreturn false;
        if (other.getCount() != null && other.getCount().equals(this.getCount()) == falsereturn false
        if (other.getDatasetSyncCount() == null ^ this.getDatasetSyncCount() == nullreturn false;
        if (other.getDatasetSyncCount() != null && other.getDatasetSyncCount().equals(this.getDatasetSyncCount()) == falsereturn false
        if (other.getLastModifiedBy() == null ^ this.getLastModifiedBy() == nullreturn false;
        if (other.getLastModifiedBy() != null && other.getLastModifiedBy().equals(this.getLastModifiedBy()) == falsereturn false
        if (other.getMergedDatasetNames() == null ^ this.getMergedDatasetNames() == nullreturn false;
        if (other.getMergedDatasetNames() != null && other.getMergedDatasetNames().equals(this.getMergedDatasetNames()) == falsereturn false
        if (other.isDatasetExists() == null ^ this.isDatasetExists() == nullreturn false;
        if (other.isDatasetExists() != null && other.isDatasetExists().equals(this.isDatasetExists()) == falsereturn false
        if (other.isDatasetDeletedAfterRequestedSyncCount() == null ^ this.isDatasetDeletedAfterRequestedSyncCount() == nullreturn false;
        if (other.isDatasetDeletedAfterRequestedSyncCount() != null && other.isDatasetDeletedAfterRequestedSyncCount().equals(this.isDatasetDeletedAfterRequestedSyncCount()) == falsereturn false
        if (other.getSyncSessionToken() == null ^ this.getSyncSessionToken() == nullreturn false;
        if (other.getSyncSessionToken() != null && other.getSyncSessionToken().equals(this.getSyncSessionToken()) == falsereturn false
        return true;
    }
    
    @Override
    public ListRecordsResult clone() {
        try {
            return (ListRecordsResultsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X