001/* 002 * ============================================================================ 003 * Copyright © 2002-2023 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.util.stringconverter; 020 021import static org.apiguardian.api.API.Status.STABLE; 022 023import java.io.Serial; 024import java.math.BigInteger; 025 026import org.apiguardian.api.API; 027import org.tquadrat.foundation.annotation.ClassVersion; 028 029/** 030 * The implementation of 031 * {@link NumberStringConverter} 032 * {@link java.math.BigInteger}. 033 * 034 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 035 * @version $Id: BigIntegerStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $ 036 * @since 0.0.6 037 * 038 * @UMLGraph.link 039 */ 040@ClassVersion( sourceVersion = "$Id: BigIntegerStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $" ) 041@API( status = STABLE, since = "0.0.6" ) 042public final class BigIntegerStringConverter extends NumberStringConverter<BigInteger> 043{ 044 /*------------------------*\ 045 ====** Static Initialisations **=========================================== 046 \*------------------------*/ 047 /** 048 * The serial version UID for objects of this class: {@value}. 049 * 050 * @hidden 051 */ 052 @Serial 053 private static final long serialVersionUID = 1L; 054 055 /** 056 * An instance of this class. 057 */ 058 public static final BigIntegerStringConverter INSTANCE = new BigIntegerStringConverter(); 059 060 /*--------------*\ 061 ====** Constructors **===================================================== 062 \*--------------*/ 063 /** 064 * Creates a new instance of {@code BigIntegerStringConverter}. 065 */ 066 public BigIntegerStringConverter() { super( BigInteger.class ); } 067 068 /*---------*\ 069 ====** Methods **========================================================== 070 \*---------*/ 071 /** 072 * {@inheritDoc} 073 */ 074 @Override 075 protected final BigInteger parseNumber( final String value ) throws NumberFormatException 076 { 077 return new BigInteger( value ); 078 } // parseNumber() 079 080 /** 081 * This method is used by the 082 * {@link java.util.ServiceLoader} 083 * to obtain the instance for this 084 * {@link org.tquadrat.foundation.lang.StringConverter} 085 * implementation. 086 * 087 * @return The instance for this {@code StringConverter} implementation. 088 */ 089 public static final BigIntegerStringConverter provider() { return INSTANCE; } 090} 091// class BigIntegerStringConverter 092 093/* 094 * End of File 095 */