001 package railo.commons.lang; 002 003 import java.io.Serializable; 004 005 /** 006 * a Simple name value Pair 007 */ 008 public final class Pair<K,V> implements Serializable { 009 K name; 010 V value; 011 012 013 /** 014 * Constructor of the class 015 * @param name 016 * @param value 017 */ 018 public Pair(K name, V value) { 019 this.name = name; 020 this.value = value; 021 } 022 023 /** 024 * @return the name 025 */ 026 public K getName() { 027 return name; 028 } 029 030 /** 031 * @param name the name to set 032 */ 033 public void setName(K name) { 034 this.name = name; 035 } 036 037 @Override 038 public String toString() { 039 return name+":"+value; 040 } 041 042 /** 043 * @return the value 044 */ 045 public V getValue() { 046 return value; 047 } 048 049 /** 050 * @param value the value to set 051 */ 052 public void setValue(V value) { 053 this.value = value; 054 } 055 056 }