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

The collection of documents that match the search request.

 
 public class Hits implements SerializableCloneable {

    
The total number of documents that match the search request.
 
     private Long found;

    
The index of the first matching document.
 
     private Long start;

    
A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.
 
     private String cursor;

    
A document that matches the search request.
 
The total number of documents that match the search request.

Returns:
The total number of documents that match the search request.
 
     public Long getFound() {
         return ;
     }
    
    
The total number of documents that match the search request.

Parameters:
found The total number of documents that match the search request.
 
     public void setFound(Long found) {
         this. = found;
     }
    
    
The total number of documents that match the search request.

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

Parameters:
found The total number of documents that match the search request.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Hits withFound(Long found) {
         this. = found;
         return this;
     }

    
The index of the first matching document.

Returns:
The index of the first matching document.
 
     public Long getStart() {
         return ;
     }
    
    
The index of the first matching document.

Parameters:
start The index of the first matching document.
 
     public void setStart(Long start) {
         this. = start;
     }
    
    
The index of the first matching document.

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

Parameters:
start The index of the first matching document.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Hits withStart(Long start) {
        this. = start;
        return this;
    }

    
A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.

Returns:
A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.
    public String getCursor() {
        return ;
    }
    
    
A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.

Parameters:
cursor A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.
    public void setCursor(String cursor) {
        this. = cursor;
    }
    
    
A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.

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

Parameters:
cursor A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Hits withCursor(String cursor) {
        this. = cursor;
        return this;
    }

    
A document that matches the search request.

Returns:
A document that matches the search request.
    public java.util.List<HitgetHit() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Hit>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A document that matches the search request.

Parameters:
hit A document that matches the search request.
    public void setHit(java.util.Collection<Hithit) {
        if (hit == null) {
            this. = null;
            return;
        }
        hitCopy.addAll(hit);
        this. = hitCopy;
    }
    
    
A document that matches the search request.

NOTE: This method appends the values to the existing list (if any). Use setHit(java.util.Collection) or withHit(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:
hit A document that matches the search request.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Hits withHit(Hit... hit) {
        if (getHit() == nullsetHit(new java.util.ArrayList<Hit>(hit.length));
        for (Hit value : hit) {
            getHit().add(value);
        }
        return this;
    }
    
    
A document that matches the search request.

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

Parameters:
hit A document that matches the search request.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Hits withHit(java.util.Collection<Hithit) {
        if (hit == null) {
            this. = null;
        } else {
            hitCopy.addAll(hit);
            this. = hitCopy;
        }
        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 (getFound() != nullsb.append("Found: " + getFound() + ",");
        if (getStart() != nullsb.append("Start: " + getStart() + ",");
        if (getCursor() != nullsb.append("Cursor: " + getCursor() + ",");
        if (getHit() != nullsb.append("Hit: " + getHit() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getFound() == null) ? 0 : getFound().hashCode()); 
        hashCode = prime * hashCode + ((getStart() == null) ? 0 : getStart().hashCode()); 
        hashCode = prime * hashCode + ((getCursor() == null) ? 0 : getCursor().hashCode()); 
        hashCode = prime * hashCode + ((getHit() == null) ? 0 : getHit().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Hits == falsereturn false;
        Hits other = (Hits)obj;
        
        if (other.getFound() == null ^ this.getFound() == nullreturn false;
        if (other.getFound() != null && other.getFound().equals(this.getFound()) == falsereturn false
        if (other.getStart() == null ^ this.getStart() == nullreturn false;
        if (other.getStart() != null && other.getStart().equals(this.getStart()) == falsereturn false
        if (other.getCursor() == null ^ this.getCursor() == nullreturn false;
        if (other.getCursor() != null && other.getCursor().equals(this.getCursor()) == falsereturn false
        if (other.getHit() == null ^ this.getHit() == nullreturn false;
        if (other.getHit() != null && other.getHit().equals(this.getHit()) == falsereturn false
        return true;
    }
    
    @Override
    public Hits clone() {
        try {
            return (Hitssuper.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