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 output for DescribeStream .

 
 public class StreamDescription implements SerializableCloneable {

    
The name of the stream being described.

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

 
     private String streamName;

    
The Amazon Resource Name (ARN) for the stream being described.
 
     private String streamARN;

    
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.

Constraints:
Allowed Values: CREATING, DELETING, ACTIVE, UPDATING

 
     private String streamStatus;

    
The shards that comprise the stream.
 
If set to true, more shards in the stream are available to describe.
 
     private Boolean hasMoreShards;

    
The name of the stream being described.

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

Returns:
The name of the stream being described.
 
     public String getStreamName() {
         return ;
     }
    
    
The name of the stream being described.

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

Parameters:
streamName The name of the stream being described.
 
     public void setStreamName(String streamName) {
         this. = streamName;
     }
    
    
The name of the stream being described.

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

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

Parameters:
streamName The name of the stream being described.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StreamDescription withStreamName(String streamName) {
        this. = streamName;
        return this;
    }

    
The Amazon Resource Name (ARN) for the stream being described.

Returns:
The Amazon Resource Name (ARN) for the stream being described.
    public String getStreamARN() {
        return ;
    }
    
    
The Amazon Resource Name (ARN) for the stream being described.

Parameters:
streamARN The Amazon Resource Name (ARN) for the stream being described.
    public void setStreamARN(String streamARN) {
        this. = streamARN;
    }
    
    
The Amazon Resource Name (ARN) for the stream being described.

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

Parameters:
streamARN The Amazon Resource Name (ARN) for the stream being described.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StreamDescription withStreamARN(String streamARN) {
        this. = streamARN;
        return this;
    }

    
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.

Constraints:
Allowed Values: CREATING, DELETING, ACTIVE, UPDATING

Returns:
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.
See also:
StreamStatus
    public String getStreamStatus() {
        return ;
    }
    
    
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.

Constraints:
Allowed Values: CREATING, DELETING, ACTIVE, UPDATING

Parameters:
streamStatus The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.
See also:
StreamStatus
    public void setStreamStatus(String streamStatus) {
        this. = streamStatus;
    }
    
    
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.

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

Constraints:
Allowed Values: CREATING, DELETING, ACTIVE, UPDATING

Parameters:
streamStatus The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
StreamStatus
    public StreamDescription withStreamStatus(String streamStatus) {
        this. = streamStatus;
        return this;
    }

    
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.

Constraints:
Allowed Values: CREATING, DELETING, ACTIVE, UPDATING

Parameters:
streamStatus The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.
See also:
StreamStatus
    public void setStreamStatus(StreamStatus streamStatus) {
        this. = streamStatus.toString();
    }
    
    
The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.

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

Constraints:
Allowed Values: CREATING, DELETING, ACTIVE, UPDATING

Parameters:
streamStatus The current status of the stream being described.

The stream status is one of the following states:

  • CREATING - The stream is being created. Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
  • DELETING - The stream is being deleted. The specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
  • ACTIVE - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream.
  • UPDATING - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
StreamStatus
    public StreamDescription withStreamStatus(StreamStatus streamStatus) {
        this. = streamStatus.toString();
        return this;
    }

    
The shards that comprise the stream.

Returns:
The shards that comprise the stream.
    public java.util.List<ShardgetShards() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Shard>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The shards that comprise the stream.

Parameters:
shards The shards that comprise the stream.
    public void setShards(java.util.Collection<Shardshards) {
        if (shards == null) {
            this. = null;
            return;
        }
        shardsCopy.addAll(shards);
        this. = shardsCopy;
    }
    
    
The shards that comprise the stream.

NOTE: This method appends the values to the existing list (if any). Use setShards(java.util.Collection) or withShards(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:
shards The shards that comprise the stream.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StreamDescription withShards(Shard... shards) {
        if (getShards() == nullsetShards(new java.util.ArrayList<Shard>(shards.length));
        for (Shard value : shards) {
            getShards().add(value);
        }
        return this;
    }
    
    
The shards that comprise the stream.

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

Parameters:
shards The shards that comprise the stream.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (shards == null) {
            this. = null;
        } else {
            shardsCopy.addAll(shards);
            this. = shardsCopy;
        }
        return this;
    }

    
If set to true, more shards in the stream are available to describe.

Returns:
If set to true, more shards in the stream are available to describe.
    public Boolean isHasMoreShards() {
        return ;
    }
    
    
If set to true, more shards in the stream are available to describe.

Parameters:
hasMoreShards If set to true, more shards in the stream are available to describe.
    public void setHasMoreShards(Boolean hasMoreShards) {
        this. = hasMoreShards;
    }
    
    
If set to true, more shards in the stream are available to describe.

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

Parameters:
hasMoreShards If set to true, more shards in the stream are available to describe.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StreamDescription withHasMoreShards(Boolean hasMoreShards) {
        this. = hasMoreShards;
        return this;
    }

    
If set to true, more shards in the stream are available to describe.

Returns:
If set to true, more shards in the stream are available to describe.
    public Boolean getHasMoreShards() {
        return ;
    }

    
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 (getStreamName() != nullsb.append("StreamName: " + getStreamName() + ",");
        if (getStreamARN() != nullsb.append("StreamARN: " + getStreamARN() + ",");
        if (getStreamStatus() != nullsb.append("StreamStatus: " + getStreamStatus() + ",");
        if (getShards() != nullsb.append("Shards: " + getShards() + ",");
        if (isHasMoreShards() != nullsb.append("HasMoreShards: " + isHasMoreShards() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStreamName() == null) ? 0 : getStreamName().hashCode()); 
        hashCode = prime * hashCode + ((getStreamARN() == null) ? 0 : getStreamARN().hashCode()); 
        hashCode = prime * hashCode + ((getStreamStatus() == null) ? 0 : getStreamStatus().hashCode()); 
        hashCode = prime * hashCode + ((getShards() == null) ? 0 : getShards().hashCode()); 
        hashCode = prime * hashCode + ((isHasMoreShards() == null) ? 0 : isHasMoreShards().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof StreamDescription == falsereturn false;
        StreamDescription other = (StreamDescription)obj;
        
        if (other.getStreamName() == null ^ this.getStreamName() == nullreturn false;
        if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == falsereturn false
        if (other.getStreamARN() == null ^ this.getStreamARN() == nullreturn false;
        if (other.getStreamARN() != null && other.getStreamARN().equals(this.getStreamARN()) == falsereturn false
        if (other.getStreamStatus() == null ^ this.getStreamStatus() == nullreturn false;
        if (other.getStreamStatus() != null && other.getStreamStatus().equals(this.getStreamStatus()) == falsereturn false
        if (other.getShards() == null ^ this.getShards() == nullreturn false;
        if (other.getShards() != null && other.getShards().equals(this.getShards()) == falsereturn false
        if (other.isHasMoreShards() == null ^ this.isHasMoreShards() == nullreturn false;
        if (other.isHasMoreShards() != null && other.isHasMoreShards().equals(this.isHasMoreShards()) == falsereturn false
        return true;
    }
    
    @Override
    public StreamDescription clone() {
        try {
            return (StreamDescriptionsuper.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