All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.lespaul361.commons.commonroutines.utilities.NameValuePair Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
/*
 * 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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy