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

de.bytefish.fcmjava.client.utils.OutParameter Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version
package de.bytefish.fcmjava.client.utils;

/**
 * Out Parameter to enable try-Methods for simpler code. A try method using an
 * OutParameter should always initialize the OutParameter first, so you have a
 * valid reference.
 *
 * @param  Out Result
 */
public class OutParameter {

    private E ref;

    public OutParameter() {
    }

    /**
     * Gets the Result of the OutParameter.
     *
     * @return Result
     */
    public E get() {
        return ref;
    }

    /**
     * Sets the OutParameter.
     *
     * @param e Result
     */
    public void set(E e) {
        this.ref = e;
    }

    /**
     * Overrides the toString Method to print the reference
     * of the OutParameter instead of itself.
     *
     * @return String Representation of the Result.
     */
    public String toString() {
        return ref.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy