001/* 002 * ============================================================================ 003 * Copyright © 2002-2026 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.jsonbuilder; 019 020import static org.apiguardian.api.API.Status.STABLE; 021 022import java.math.BigDecimal; 023import java.math.BigInteger; 024 025import org.apiguardian.api.API; 026import org.tquadrat.foundation.annotation.ClassVersion; 027import org.tquadrat.foundation.jsonbuilder.internal.JSONNumberImpl; 028 029/** 030 * <p>{@summary The definition of a JSON number.}</p>> 031 * 032 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 033 * @version $Id: JSONNumber.java 1187 2026-04-07 11:01:35Z tquadrat $ 034 * @since 0.25.0 035 * 036 * @UMLGraph.link 037 */ 038@ClassVersion( sourceVersion = "$Id: JSONNumber.java 1187 2026-04-07 11:01:35Z tquadrat $" ) 039@API( status = STABLE, since = "0.25.0" ) 040public sealed interface JSONNumber extends JSONValue 041 permits JSONNumberImpl 042{ 043 /*---------*\ 044 ====** Methods **========================================================== 045 \*---------*/ 046 /** 047 * <p>{@summary Returns the value as an 048 * {@link BigDecimal}.}</p> 049 * 050 * @return The value. 051 * @throws NumberFormatException The value cannot be parsed to a valid 052 * {@link BigDecimal}. 053 */ 054 public BigDecimal getBigDecimal() throws NumberFormatException; 055 056 /** 057 * <p>{@summary Returns the value as an 058 * {@link BigInteger}.}</p> 059 * 060 * @return The value. 061 * @throws NumberFormatException The value cannot be parsed to a valid 062 * {@link BigInteger}. 063 */ 064 public BigInteger getBigInteger() throws NumberFormatException; 065 066 /** 067 * <p>{@summary Returns the value as an {@code double}.}</p> 068 * 069 * @return The value. 070 * @throws NumberFormatException The value cannot be parsed to a valid 071 * {@code double}. 072 */ 073 public double getDouble() throws NumberFormatException; 074 075 /** 076 * <p>{@summary Returns the value as an {@code float}.}</p> 077 * 078 * @return The value. 079 * @throws NumberFormatException The value cannot be parsed to a valid 080 * {@code float}. 081 */ 082 public float getFloat() throws NumberFormatException; 083 084 /** 085 * <p>{@summary Returns the value as an {@code int}.}</p> 086 * 087 * @return The value. 088 * @throws NumberFormatException The value cannot be parsed to a valid 089 * {@code int}. 090 */ 091 public int getInt() throws NumberFormatException; 092 093 /** 094 * <p>{@summary Returns the value as an {@code long}.}</p> 095 * 096 * @return The value. 097 * @throws NumberFormatException The value cannot be parsed to a valid 098 * {@code long}. 099 */ 100 public long getLong() throws NumberFormatException; 101} 102// interface JSONNumber 103 104/* 105 * End of File 106 */