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.machinelearning.model;
 
 
Container for the parameters to the Predict operation.

Generates a prediction for the observation using the specified MLModel .

NOTE: Note Not all response parameters will be populated because this is dependent on the type of requested model.

 
 public class PredictRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
A unique identifier of the MLModel.

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

 
     private String mLModelId;

    
A map of variable name-value pairs that represent an observation.
 
     private java.util.Map<String,Stringrecord;
 
     private String predictEndpoint;

    
A unique identifier of the MLModel.

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

Returns:
A unique identifier of the MLModel.
 
     public String getMLModelId() {
         return ;
     }
    
    
A unique identifier of the MLModel.

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

Parameters:
mLModelId A unique identifier of the MLModel.
 
     public void setMLModelId(String mLModelId) {
         this. = mLModelId;
     }
    
    
A unique identifier of the MLModel.

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

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

Parameters:
mLModelId A unique identifier of the MLModel.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PredictRequest withMLModelId(String mLModelId) {
         this. = mLModelId;
         return this;
     }

    
A map of variable name-value pairs that represent an observation.

Returns:
A map of variable name-value pairs that represent an observation.
    public java.util.Map<String,StringgetRecord() {
        
        if ( == null) {
             = new java.util.HashMap<String,String>();
        }
        return ;
    }
    
    
A map of variable name-value pairs that represent an observation.

Parameters:
record A map of variable name-value pairs that represent an observation.
    public void setRecord(java.util.Map<String,Stringrecord) {
        this. = record;
    }
    
    
A map of variable name-value pairs that represent an observation.

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

Parameters:
record A map of variable name-value pairs that represent an observation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PredictRequest withRecord(java.util.Map<String,Stringrecord) {
        setRecord(record);
        return this;
    }

    
A map of variable name-value pairs that represent an observation.

The method adds a new key-value pair into Record parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into Record.
value The corresponding value of the entry to be added into Record.
  public PredictRequest addRecordEntry(String keyString value) {
    if (null == this.) {
      this. = new java.util.HashMap<String,String>();
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into Record.

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

    this. = null;
    return this;
  }
  
    
Returns the value of the PredictEndpoint property for this object.

Constraints:
Length: 0 - 2048
Pattern: https://[a-zA-Z0-9-.]*\.amazon(aws)?\.com[/]?

Returns:
The value of the PredictEndpoint property for this object.
    public String getPredictEndpoint() {
        return ;
    }
    
    
Sets the value of the PredictEndpoint property for this object.

Constraints:
Length: 0 - 2048
Pattern: https://[a-zA-Z0-9-.]*\.amazon(aws)?\.com[/]?

Parameters:
predictEndpoint The new value for the PredictEndpoint property for this object.
    public void setPredictEndpoint(String predictEndpoint) {
        this. = predictEndpoint;
    }
    
    
Sets the value of the PredictEndpoint property for this object.

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

Constraints:
Length: 0 - 2048
Pattern: https://[a-zA-Z0-9-.]*\.amazon(aws)?\.com[/]?

Parameters:
predictEndpoint The new value for the PredictEndpoint property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PredictRequest withPredictEndpoint(String predictEndpoint) {
        this. = predictEndpoint;
        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 (getMLModelId() != nullsb.append("MLModelId: " + getMLModelId() + ",");
        if (getRecord() != nullsb.append("Record: " + getRecord() + ",");
        if (getPredictEndpoint() != nullsb.append("PredictEndpoint: " + getPredictEndpoint() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getMLModelId() == null) ? 0 : getMLModelId().hashCode()); 
        hashCode = prime * hashCode + ((getRecord() == null) ? 0 : getRecord().hashCode()); 
        hashCode = prime * hashCode + ((getPredictEndpoint() == null) ? 0 : getPredictEndpoint().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PredictRequest == falsereturn false;
        PredictRequest other = (PredictRequest)obj;
        
        if (other.getMLModelId() == null ^ this.getMLModelId() == nullreturn false;
        if (other.getMLModelId() != null && other.getMLModelId().equals(this.getMLModelId()) == falsereturn false
        if (other.getRecord() == null ^ this.getRecord() == nullreturn false;
        if (other.getRecord() != null && other.getRecord().equals(this.getRecord()) == falsereturn false
        if (other.getPredictEndpoint() == null ^ this.getPredictEndpoint() == nullreturn false;
        if (other.getPredictEndpoint() != null && other.getPredictEndpoint().equals(this.getPredictEndpoint()) == falsereturn false
        return true;
    }
    
    @Override
    public PredictRequest clone() {
        
            return (PredictRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X