| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.util.json; |
| 7 |
|
| 8 |
/** |
| 9 |
* JSON string. |
| 10 |
*/ |
| 11 |
public final class JSONString extends JSONValue { |
| 12 |
|
| 13 |
private final String value; |
| 14 |
|
| 15 |
JSONString(String value) { |
| 16 |
this.value = value; |
| 17 |
} |
| 18 |
|
| 19 |
@Override |
| 20 |
public void addTo(JSONTarget<?> target) { |
| 21 |
target.valueString(value); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Returns the value. |
| 26 |
* |
| 27 |
* @return the value |
| 28 |
*/ |
| 29 |
public String getString() { |
| 30 |
return value; |
| 31 |
} |
| 32 |
|
| 33 |
} |