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

Creates a platform application object for one of the supported push notification services, such as APNS and GCM, to which devices and mobile apps may register. You must specify PlatformPrincipal and PlatformCredential attributes when using the CreatePlatformApplication action. The PlatformPrincipal is received from the notification service. For APNS/APNS_SANDBOX, PlatformPrincipal is "SSL certificate". For GCM, PlatformPrincipal is not applicable. For ADM, PlatformPrincipal is "client id". The PlatformCredential is also received from the notification service. For APNS/APNS_SANDBOX, PlatformCredential is "private key". For GCM, PlatformCredential is "API key". For ADM, PlatformCredential is "client secret". The PlatformApplicationArn that is returned when using CreatePlatformApplication is then used as an attribute for the CreatePlatformEndpoint action. For more information, see Using Amazon SNS Mobile Push Notifications .

 
 public class CreatePlatformApplicationRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.
 
     private String name;

    
The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).
 
     private String platform;

    
For a list of attributes, see SetPlatformApplicationAttributes
 
     private java.util.Map<String,Stringattributes;

    
Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.

Returns:
Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.
 
     public String getName() {
         return ;
     }
    
    
Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.

Parameters:
name Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.
 
     public void setName(String name) {
         this. = name;
     }
    
    
Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.

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

Parameters:
name Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = name;
        return this;
    }

    
The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).

Returns:
The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).
    public String getPlatform() {
        return ;
    }
    
    
The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).

Parameters:
platform The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).
    public void setPlatform(String platform) {
        this. = platform;
    }
    
    
The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).

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

Parameters:
platform The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = platform;
        return this;
    }

    
For a list of attributes, see SetPlatformApplicationAttributes

Returns:
For a list of attributes, see SetPlatformApplicationAttributes
    public java.util.Map<String,StringgetAttributes() {
        
        if ( == null) {
             = new java.util.HashMap<String,String>();
        }
        return ;
    }
    
    
For a list of attributes, see SetPlatformApplicationAttributes

Parameters:
attributes For a list of attributes, see SetPlatformApplicationAttributes
    public void setAttributes(java.util.Map<String,Stringattributes) {
        this. = attributes;
    }
    
    
For a list of attributes, see SetPlatformApplicationAttributes

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

Parameters:
attributes For a list of attributes, see SetPlatformApplicationAttributes
Returns:
A reference to this updated object so that method calls can be chained together.
        setAttributes(attributes);
        return this;
    }

    
For a list of attributes, see SetPlatformApplicationAttributes

The method adds a new key-value pair into Attributes 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 Attributes.
value The corresponding value of the entry to be added into Attributes.
    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 Attributes.

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

    this. = null;
    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 (getName() != nullsb.append("Name: " + getName() + ",");
        if (getPlatform() != nullsb.append("Platform: " + getPlatform() + ",");
        if (getAttributes() != nullsb.append("Attributes: " + getAttributes() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); 
        hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreatePlatformApplicationRequest == falsereturn false;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getPlatform() == null ^ this.getPlatform() == nullreturn false;
        if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == falsereturn false
        if (other.getAttributes() == null ^ this.getAttributes() == nullreturn false;
        if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (CreatePlatformApplicationRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X