Changeset View
Changeset View
Standalone View
Standalone View
src/main/java/net/wildfyre/utils/JsonUtils.kt
- This file was added.
/* | |||||
* Copyright 2019 Wildfyre.net | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
// This file only contains methods that are given for convenience to the other classes. It's not a worry if they're | |||||
// not used. | |||||
@file:Suppress("unused") | |||||
package net.wildfyre.utils | |||||
import com.eclipsesource.json.JsonValue | |||||
import com.eclipsesource.json.WriterConfig | |||||
/** | |||||
* Shortcut to get a String of the JSON value in [WriterConfig.MINIMAL] mode. | |||||
*/ | |||||
internal fun JsonValue.minimalString() = this.toString(WriterConfig.MINIMAL)!! | |||||
/** | |||||
* Shortcut to get a String of the JSON value in [WriterConfig.PRETTY_PRINT] mode. | |||||
*/ | |||||
internal fun JsonValue.prettyString() = this.toString(WriterConfig.PRETTY_PRINT)!! |