
com.github.lespaul361.commons.commonroutines.utilities.NameValuePair Maven / Gradle / Ivy
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
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;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy