com.github.lespaul361.commons.commonroutines.utilities.NameValuePair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Commons-CommonRoutines Show documentation
Show all versions of Commons-CommonRoutines Show documentation
common routines I use in my projects
/*
* Copyright (C) 2019 Charles Hamilton
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package com.github.lespaul361.commons.commonroutines.utilities;
import java.io.Serializable;
/**
*
* @author David Hamilton
* @param the data type this class uses
*/
public class NameValuePair implements Serializable {
private String name = "";
private T value = null;
/**
* Constructs an empty NameValuePair
*/
public NameValuePair() {
this(null, null);
}
/**
* Constructs a NameValuePair
with a name
*
* @param name the name of the pair
*/
public NameValuePair(String name) {
this(name, null);
}
/**
* Constructs a NameValuePair
with name and value
*
* @param name the name of the pair
* @param value the value of the pair
*/
public NameValuePair(String name, T value) {
this.name = name;
this.value = value;
}
/**
* Gets the name of the NameValuePair
*
* @return the name the name of the NameValuePair
*/
public String getName() {
return name;
}
/**
* Sets the name of the NameValuePair
*
* @param name the name of the NameValuePair
*/
public void setName(String name) {
this.name = name;
}
/**
* Get the value of the NameValuePair
*
* @return the value the value of the NameValuePair
*/
public T getValue() {
return value;
}
/**
* Sets the value of the NameValuePair
*
* @param value the value of the NameValuePair
*/
public void setValue(T value) {
this.value = value;
}
}