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;
 

A uniquely identified group of data records in an Amazon Kinesis stream.

 
 public class Shard implements SerializableCloneable {

    
The unique identifier of the shard within the Amazon Kinesis stream.

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

 
     private String shardId;

    
The shard Id of the shard's parent.

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

 
     private String parentShardId;

    
The shard Id of the shard adjacent to the shard's parent.

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

 
     private String adjacentParentShardId;

    
The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.
 
     private HashKeyRange hashKeyRange;

    
The range of possible sequence numbers for the shard.
 
     private SequenceNumberRange sequenceNumberRange;

    
The unique identifier of the shard within the Amazon Kinesis stream.

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

Returns:
The unique identifier of the shard within the Amazon Kinesis stream.
 
     public String getShardId() {
         return ;
     }
    
    
The unique identifier of the shard within the Amazon Kinesis stream.

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

Parameters:
shardId The unique identifier of the shard within the Amazon Kinesis stream.
 
     public void setShardId(String shardId) {
         this. = shardId;
     }
    
    
The unique identifier of the shard within the Amazon Kinesis stream.

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 unique identifier of the shard within the Amazon Kinesis stream.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Shard withShardId(String shardId) {
        this. = shardId;
        return this;
    }

    
The shard Id of the shard's parent.

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

Returns:
The shard Id of the shard's parent.
    public String getParentShardId() {
        return ;
    }
    
    
The shard Id of the shard's parent.

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

Parameters:
parentShardId The shard Id of the shard's parent.
    public void setParentShardId(String parentShardId) {
        this. = parentShardId;
    }
    
    
The shard Id of the shard's parent.

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

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

Parameters:
parentShardId The shard Id of the shard's parent.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Shard withParentShardId(String parentShardId) {
        this. = parentShardId;
        return this;
    }

    
The shard Id of the shard adjacent to the shard's parent.

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

Returns:
The shard Id of the shard adjacent to the shard's parent.
    public String getAdjacentParentShardId() {
        return ;
    }
    
    
The shard Id of the shard adjacent to the shard's parent.

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

Parameters:
adjacentParentShardId The shard Id of the shard adjacent to the shard's parent.
    public void setAdjacentParentShardId(String adjacentParentShardId) {
        this. = adjacentParentShardId;
    }
    
    
The shard Id of the shard adjacent to the shard's parent.

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

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

Parameters:
adjacentParentShardId The shard Id of the shard adjacent to the shard's parent.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Shard withAdjacentParentShardId(String adjacentParentShardId) {
        this. = adjacentParentShardId;
        return this;
    }

    
The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.

Returns:
The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.
    public HashKeyRange getHashKeyRange() {
        return ;
    }
    
    
The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.

Parameters:
hashKeyRange The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.
    public void setHashKeyRange(HashKeyRange hashKeyRange) {
        this. = hashKeyRange;
    }
    
    
The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.

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

Parameters:
hashKeyRange The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Shard withHashKeyRange(HashKeyRange hashKeyRange) {
        this. = hashKeyRange;
        return this;
    }

    
The range of possible sequence numbers for the shard.

Returns:
The range of possible sequence numbers for the shard.
        return ;
    }
    
    
The range of possible sequence numbers for the shard.

Parameters:
sequenceNumberRange The range of possible sequence numbers for the shard.
    public void setSequenceNumberRange(SequenceNumberRange sequenceNumberRange) {
        this. = sequenceNumberRange;
    }
    
    
The range of possible sequence numbers for the shard.

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

Parameters:
sequenceNumberRange The range of possible sequence numbers for the shard.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Shard withSequenceNumberRange(SequenceNumberRange sequenceNumberRange) {
        this. = sequenceNumberRange;
        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 (getShardId() != nullsb.append("ShardId: " + getShardId() + ",");
        if (getParentShardId() != nullsb.append("ParentShardId: " + getParentShardId() + ",");
        if (getAdjacentParentShardId() != nullsb.append("AdjacentParentShardId: " + getAdjacentParentShardId() + ",");
        if (getHashKeyRange() != nullsb.append("HashKeyRange: " + getHashKeyRange() + ",");
        if (getSequenceNumberRange() != nullsb.append("SequenceNumberRange: " + getSequenceNumberRange() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getShardId() == null) ? 0 : getShardId().hashCode()); 
        hashCode = prime * hashCode + ((getParentShardId() == null) ? 0 : getParentShardId().hashCode()); 
        hashCode = prime * hashCode + ((getAdjacentParentShardId() == null) ? 0 : getAdjacentParentShardId().hashCode()); 
        hashCode = prime * hashCode + ((getHashKeyRange() == null) ? 0 : getHashKeyRange().hashCode()); 
        hashCode = prime * hashCode + ((getSequenceNumberRange() == null) ? 0 : getSequenceNumberRange().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Shard == falsereturn false;
        Shard other = (Shard)obj;
        
        if (other.getShardId() == null ^ this.getShardId() == nullreturn false;
        if (other.getShardId() != null && other.getShardId().equals(this.getShardId()) == falsereturn false
        if (other.getParentShardId() == null ^ this.getParentShardId() == nullreturn false;
        if (other.getParentShardId() != null && other.getParentShardId().equals(this.getParentShardId()) == falsereturn false
        if (other.getAdjacentParentShardId() == null ^ this.getAdjacentParentShardId() == nullreturn false;
        if (other.getAdjacentParentShardId() != null && other.getAdjacentParentShardId().equals(this.getAdjacentParentShardId()) == falsereturn false
        if (other.getHashKeyRange() == null ^ this.getHashKeyRange() == nullreturn false;
        if (other.getHashKeyRange() != null && other.getHashKeyRange().equals(this.getHashKeyRange()) == falsereturn false
        if (other.getSequenceNumberRange() == null ^ this.getSequenceNumberRange() == nullreturn false;
        if (other.getSequenceNumberRange() != null && other.getSequenceNumberRange().equals(this.getSequenceNumberRange()) == falsereturn false
        return true;
    }
    
    @Override
    public Shard clone() {
        try {
            return (Shardsuper.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