This project has retired. For details please refer to its Attic page.
Source code
001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.reef.runtime.hdinsight.client.yarnrest;
020
021/**
022 * An Entry in the Environment field of an ApplicationSubmission
023 */
024public final class EnvironmentEntry {
025
026  private String key;
027  private String value;
028
029  public EnvironmentEntry(final String key, final String value) {
030    this.key = key;
031    this.value = value;
032  }
033
034  public String getKey() {
035    return this.key;
036  }
037
038  public void setKey(final String key) {
039    this.key = key;
040  }
041
042  public String getValue() {
043    return this.value;
044  }
045
046  public void setValue(final String value) {
047    this.value = value;
048  }
049
050  @Override
051  public String toString() {
052    return "EnvironmentEntry{" +
053        "key='" + this.key + '\'' +
054        ", value='" + this.value + '\'' +
055        '}';
056  }
057
058  @Override
059  public boolean equals(final Object o) {
060
061    if (this == o) return true;
062    if (o == null || getClass() != o.getClass()) return false;
063
064    final EnvironmentEntry that = (EnvironmentEntry) o;
065
066    return (this.key == that.key || (this.key != null && this.key.equals(that.key)))
067        && (this.value == that.value || (this.value != null && this.value.equals(that.value)));
068  }
069
070  @Override
071  public int hashCode() {
072    int result = this.key != null ? this.key.hashCode() : 0;
073    result = 31 * result + (this.value != null ? this.value.hashCode() : 0);
074    return result;
075  }
076}