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.kinesis.model;
 

Represents the result of an individual record from a PutRecords request. A record that is successfully added to your Amazon Kinesis stream includes SequenceNumber and ShardId in the result. A record that fails to be added to your Amazon Kinesis stream includes ErrorCode and ErrorMessage in the result.

 
 public class PutRecordsResultEntry implements SerializableCloneable {

    
The sequence number for an individual record result.

Constraints:
Pattern: 0|([1-9]\d{0,128})

 
     private String sequenceNumber;

    
The shard ID for an individual record result.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

 
     private String shardId;

    
The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.
 
     private String errorCode;

    
The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".
 
     private String errorMessage;

    
The sequence number for an individual record result.

Constraints:
Pattern: 0|([1-9]\d{0,128})

Returns:
The sequence number for an individual record result.
 
     public String getSequenceNumber() {
         return ;
     }
    
    
The sequence number for an individual record result.

Constraints:
Pattern: 0|([1-9]\d{0,128})

Parameters:
sequenceNumber The sequence number for an individual record result.
 
     public void setSequenceNumber(String sequenceNumber) {
         this. = sequenceNumber;
     }
    
    
The sequence number for an individual record result.

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

Constraints:
Pattern: 0|([1-9]\d{0,128})

Parameters:
sequenceNumber The sequence number for an individual record result.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutRecordsResultEntry withSequenceNumber(String sequenceNumber) {
        this. = sequenceNumber;
        return this;
    }

    
The shard ID for an individual record result.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Returns:
The shard ID for an individual record result.
    public String getShardId() {
        return ;
    }
    
    
The shard ID for an individual record result.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
shardId The shard ID for an individual record result.
    public void setShardId(String shardId) {
        this. = shardId;
    }
    
    
The shard ID for an individual record result.

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

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
shardId The shard ID for an individual record result.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutRecordsResultEntry withShardId(String shardId) {
        this. = shardId;
        return this;
    }

    
The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.

Returns:
The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.
    public String getErrorCode() {
        return ;
    }
    
    
The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.

Parameters:
errorCode The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.
    public void setErrorCode(String errorCode) {
        this. = errorCode;
    }
    
    
The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.

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

Parameters:
errorCode The error code for an individual record result. ErrorCodes can be either ProvisionedThroughputExceededException or InternalFailure.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutRecordsResultEntry withErrorCode(String errorCode) {
        this. = errorCode;
        return this;
    }

    
The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".

Returns:
The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".
    public String getErrorMessage() {
        return ;
    }
    
    
The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".

Parameters:
errorMessage The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".
    public void setErrorMessage(String errorMessage) {
        this. = errorMessage;
    }
    
    
The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".

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

Parameters:
errorMessage The error message for an individual record result. An ErrorCode value of ProvisionedThroughputExceededException has an error message that includes the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure has the error message "Internal Service Failure".
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutRecordsResultEntry withErrorMessage(String errorMessage) {
        this. = errorMessage;
        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 (getSequenceNumber() != nullsb.append("SequenceNumber: " + getSequenceNumber() + ",");
        if (getShardId() != nullsb.append("ShardId: " + getShardId() + ",");
        if (getErrorCode() != nullsb.append("ErrorCode: " + getErrorCode() + ",");
        if (getErrorMessage() != nullsb.append("ErrorMessage: " + getErrorMessage() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSequenceNumber() == null) ? 0 : getSequenceNumber().hashCode()); 
        hashCode = prime * hashCode + ((getShardId() == null) ? 0 : getShardId().hashCode()); 
        hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode()); 
        hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PutRecordsResultEntry == falsereturn false;
        PutRecordsResultEntry other = (PutRecordsResultEntry)obj;
        
        if (other.getSequenceNumber() == null ^ this.getSequenceNumber() == nullreturn false;
        if (other.getSequenceNumber() != null && other.getSequenceNumber().equals(this.getSequenceNumber()) == falsereturn false
        if (other.getShardId() == null ^ this.getShardId() == nullreturn false;
        if (other.getShardId() != null && other.getShardId().equals(this.getShardId()) == falsereturn false
        if (other.getErrorCode() == null ^ this.getErrorCode() == nullreturn false;
        if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == falsereturn false
        if (other.getErrorMessage() == null ^ this.getErrorMessage() == nullreturn false;
        if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == falsereturn false
        return true;
    }
    
    @Override
    public PutRecordsResultEntry clone() {
        try {
            return (PutRecordsResultEntrysuper.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