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

io.tracee.contextlogger.data.subdata.NameValuePair Maven / Gradle / Ivy

The newest version!
package io.tracee.contextlogger.data.subdata;

import io.tracee.contextlogger.api.TraceeContextLogProvider;
import io.tracee.contextlogger.api.TraceeContextLogProviderMethod;

/**
 * Main Interface for name value pairs.
 * Created by Tobias Gindler on 21.03.14.
 */
@TraceeContextLogProvider(displayName = "name-value-pair")
public abstract class NameValuePair {

    protected static final String DEFAULT_NAME = "";

    private final String name;
    private final T value;

    public NameValuePair(final String name, final T value) {
        this.name = name != null ? name : DEFAULT_NAME;
        this.value = value;
    }

    /**
     * Gets the name for the value.
     *
     * @return the name for the value
     */
    @TraceeContextLogProviderMethod(displayName = "name", propertyName = "", order = 1)
    public final String getName() {
        return this.name;
    }

    /**
     * Gets the value.
     *
     * @return the value
     */
    @TraceeContextLogProviderMethod(displayName = "value", propertyName = "", order = 2)
    public final T getValue() {
        return this.value;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy