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

im.dadoo.spring.jdbc.support.util.Pair Maven / Gradle / Ivy

The newest version!
/*
 * 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 im.dadoo.spring.jdbc.support.util;

import java.io.Serializable;

/**
 * 

Pair is used to define sql parameter which contains two field.

*

For example, BETWEEN clause contains two fields such as begin and end

* @author codekitten * @since 0.1 */ public final class Pair implements Serializable { private static final long serialVersionUID = -6106927893230115331L; private V1 v1; private V2 v2; public Pair(V1 v1, V2 v2) { this.v1 = v1; this.v2 = v2; } /** * This function used to create a new Pair object. * * @param v1 left value * @param v2 right value * @return pair object * @since 0.1 */ public static Pair of(V1 v1, V2 v2) { return new Pair<>(v1, v2); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Pair [v1="); builder.append(v1); builder.append(", v2="); builder.append(v2); builder.append("]"); return builder.toString(); } public V1 getV1() { return v1; } public void setV1(V1 v1) { this.v1 = v1; } public V2 getV2() { return v2; } public void setV2(V2 v2) { this.v2 = v2; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy