001/* 002 * ============================================================================ 003 * Copyright © 2002-2024 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * 007 * Licensed to the public under the agreements of the GNU Lesser General Public 008 * License, version 3.0 (the "License"). You may obtain a copy of the License at 009 * 010 * http://www.gnu.org/licenses/lgpl.html 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 014 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 015 * License for the specific language governing permissions and limitations 016 * under the License. 017 */ 018 019package org.tquadrat.foundation.sql.internal; 020 021import static org.apiguardian.api.API.Status.INTERNAL; 022 023import java.io.Serial; 024import java.io.Serializable; 025import java.sql.SQLType; 026 027import org.apiguardian.api.API; 028import org.tquadrat.foundation.annotation.ClassVersion; 029 030/** 031 * <p>{@summary A value for an 032 * {@link org.tquadrat.foundation.sql.EnhancedPreparedStatement }.} 033 * 034 * @param parameterName The name of the parameter. 035 * @param type The SQL type. 036 * @param value A String representation of the value; it can be 037 * {@code null} if the value is {@code null}, but it could be also the 038 * value of 039 * {@link org.tquadrat.foundation.lang.CommonConstants#NULL_STRING}. 040 * 041 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 042 * @version $Id: StatementValue.java 1105 2024-02-28 12:58:46Z tquadrat $ 043 * @since 0.0.1 044 * 045 * @UMLGraph.link 046 */ 047@ClassVersion( sourceVersion = "$Id: StatementValue.java 1105 2024-02-28 12:58:46Z tquadrat $" ) 048@API( status = INTERNAL, since = "0.0.1" ) 049public record StatementValue( String parameterName, SQLType type, String value ) implements Serializable 050{ 051 /*------------------------*\ 052 ====** Static Initialisations **=========================================== 053 \*------------------------*/ 054 /** 055 * The serial version UID for objects of this class: {@value}. 056 * 057 * @hidden 058 */ 059 @Serial 060 private static final long serialVersionUID = 1L; 061 062 /*---------*\ 063 ====** Methods **========================================================== 064 \*---------*/ 065 /** 066 * {@inheritDoc} 067 */ 068 @Override 069 public final String toString() 070 { 071 final var retValue = getClass().getName() + 072 " [Parameter: " + parameterName + 073 ", Type: " + type.getName() + 074 ", Value: " + value + 075 "]"; 076 077 //---* Done *---------------------------------------------------------- 078 return retValue; 079 } // toString() 080} 081// record StatementValue 082 083/* 084 * End of File 085 */