@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getArgs() == null) ? 0 : getArgs().hashCode()); hashCode = prime * hashCode + ((getAdditionalInfo() == null) ? 0 : getAdditionalInfo().hashCode()); return hashCode; }
/** * <p> * This option is for advanced users only. This is meta information about third-party applications that third-party * vendors use for testing purposes. * </p> * * @param additionalInfo * This option is for advanced users only. This is meta information about third-party applications that * third-party vendors use for testing purposes. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withAdditionalInfo(java.util.Map<String, String> additionalInfo) { setAdditionalInfo(additionalInfo); return this; }
/** * <p> * Arguments for Amazon EMR to pass to the application. * </p> * * @param args * Arguments for Amazon EMR to pass to the application. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withArgs(java.util.Collection<String> args) { setArgs(args); return this; }
public Application unmarshall(JsonUnmarshallerContext context) throws Exception { Application application = new Application(); if (context.testExpression("Name", targetDepth)) { context.nextToken(); application.setName(context.getUnmarshaller(String.class).unmarshall(context)); application.setVersion(context.getUnmarshaller(String.class).unmarshall(context)); application.setArgs(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context)); application.setAdditionalInfo(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context .getUnmarshaller(String.class)).unmarshall(context));
Application sparkApp = new Application().withName("Spark");
/** * <p> * The name of the application. * </p> * * @param name * The name of the application. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withName(String name) { setName(name); return this; }
/** * Converts the given list of {@link EmrClusterDefinitionApplication} into a list of {@link Application} * * @param emrClusterDefinitionApplications list of {@link EmrClusterDefinitionApplication} * * @return list {@link Application} */ public List<Application> getApplications(List<EmrClusterDefinitionApplication> emrClusterDefinitionApplications) { List<Application> applications = new ArrayList<>(); for (EmrClusterDefinitionApplication emrClusterDefinitionApplication : emrClusterDefinitionApplications) { Application application = new Application(); application.setName(emrClusterDefinitionApplication.getName()); application.setVersion(emrClusterDefinitionApplication.getVersion()); application.setArgs(emrClusterDefinitionApplication.getArgs()); List<Parameter> additionalInfoList = emrClusterDefinitionApplication.getAdditionalInfoList(); if (!CollectionUtils.isEmpty(additionalInfoList)) { application.setAdditionalInfo(getMap(additionalInfoList)); } applications.add(application); } return applications; }
private List<Application> initApplications() { List<Application> applications = new ArrayList<>(); Application hive = new Application().withName( "Hive" ); applications.add( hive ); return applications; }
/** * <p> * The name of the application. * </p> * * @param name * The name of the application. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withName(String name) { setName(name); return this; }
/** * Converts the given list of {@link EmrClusterDefinitionApplication} into a list of {@link Application} * * @param emrClusterDefinitionApplications list of {@link EmrClusterDefinitionApplication} * * @return list {@link Application} */ public List<Application> getApplications(List<EmrClusterDefinitionApplication> emrClusterDefinitionApplications) { List<Application> applications = new ArrayList<>(); for (EmrClusterDefinitionApplication emrClusterDefinitionApplication : emrClusterDefinitionApplications) { Application application = new Application(); application.setName(emrClusterDefinitionApplication.getName()); application.setVersion(emrClusterDefinitionApplication.getVersion()); application.setArgs(emrClusterDefinitionApplication.getArgs()); List<Parameter> additionalInfoList = emrClusterDefinitionApplication.getAdditionalInfoList(); if (!CollectionUtils.isEmpty(additionalInfoList)) { application.setAdditionalInfo(getMap(additionalInfoList)); } applications.add(application); } return applications; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Application == false) return false; Application other = (Application) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; if (other.getArgs() == null ^ this.getArgs() == null) return false; if (other.getArgs() != null && other.getArgs().equals(this.getArgs()) == false) return false; if (other.getAdditionalInfo() == null ^ this.getAdditionalInfo() == null) return false; if (other.getAdditionalInfo() != null && other.getAdditionalInfo().equals(this.getAdditionalInfo()) == false) return false; return true; }
.map(application -> new Application().withName(application)) .collect(toList());
/** * <p> * Arguments for Amazon EMR to pass to the application. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setArgs(java.util.Collection)} or {@link #withArgs(java.util.Collection)} if you want to override the * existing values. * </p> * * @param args * Arguments for Amazon EMR to pass to the application. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withArgs(String... args) { if (this.args == null) { setArgs(new com.amazonaws.internal.SdkInternalList<String>(args.length)); } for (String ele : args) { this.args.add(ele); } return this; }
/** * <p> * This option is for advanced users only. This is meta information about third-party applications that third-party * vendors use for testing purposes. * </p> * * @param additionalInfo * This option is for advanced users only. This is meta information about third-party applications that * third-party vendors use for testing purposes. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withAdditionalInfo(java.util.Map<String, String> additionalInfo) { setAdditionalInfo(additionalInfo); return this; }
public Application unmarshall(JsonUnmarshallerContext context) throws Exception { Application application = new Application(); if (context.testExpression("Name", targetDepth)) { context.nextToken(); application.setName(context.getUnmarshaller(String.class).unmarshall(context)); application.setVersion(context.getUnmarshaller(String.class).unmarshall(context)); application.setArgs(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context)); application.setAdditionalInfo(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context .getUnmarshaller(String.class)).unmarshall(context));
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getArgs() != null) sb.append("Args: ").append(getArgs()).append(","); if (getAdditionalInfo() != null) sb.append("AdditionalInfo: ").append(getAdditionalInfo()); sb.append("}"); return sb.toString(); }
.withApplications(new Application().withName("Spark")) .withConfigurations(new Configuration() .withClassification("yarn-site")
/** * <p> * Arguments for Amazon EMR to pass to the application. * </p> * * @param args * Arguments for Amazon EMR to pass to the application. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withArgs(java.util.Collection<String> args) { setArgs(args); return this; }
/** * Marshall the given parameter object. */ public void marshall(Application application, ProtocolMarshaller protocolMarshaller) { if (application == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(application.getName(), NAME_BINDING); protocolMarshaller.marshall(application.getVersion(), VERSION_BINDING); protocolMarshaller.marshall(application.getArgs(), ARGS_BINDING); protocolMarshaller.marshall(application.getAdditionalInfo(), ADDITIONALINFO_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * <p> * Arguments for Amazon EMR to pass to the application. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setArgs(java.util.Collection)} or {@link #withArgs(java.util.Collection)} if you want to override the * existing values. * </p> * * @param args * Arguments for Amazon EMR to pass to the application. * @return Returns a reference to this object so that method calls can be chained together. */ public Application withArgs(String... args) { if (this.args == null) { setArgs(new com.amazonaws.internal.SdkInternalList<String>(args.length)); } for (String ele : args) { this.args.add(ele); } return this; }