JsonValueUtil.groovy revision 81db14effa88a707fad039b67f41454a99c5115b
81db14effa88a707fad039b67f41454a99c5115bJon Branch * The contents of this file are subject to the terms of the Common Development and
81db14effa88a707fad039b67f41454a99c5115bJon Branch * Distribution License (the License). You may not use this file except in compliance with the
81db14effa88a707fad039b67f41454a99c5115bJon Branch * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
81db14effa88a707fad039b67f41454a99c5115bJon Branch * specific language governing permission and limitations under the License.
81db14effa88a707fad039b67f41454a99c5115bJon Branch * When distributing Covered Software, include this CDDL Header Notice in each file and include
81db14effa88a707fad039b67f41454a99c5115bJon Branch * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
81db14effa88a707fad039b67f41454a99c5115bJon Branch * Header, with the fields enclosed by brackets [] replaced by your own identifying
81db14effa88a707fad039b67f41454a99c5115bJon Branch * information: "Portions copyright [year] [name of copyright owner]".
81db14effa88a707fad039b67f41454a99c5115bJon Branch * Copyright 2015 ForgeRock AS.
548846fe158900a483ca91f47603c6bb6fde9b47Jon Branch public static JsonValue fromEntries(Map.Entry<String,Object>[] entries) {
548846fe158900a483ca91f47603c6bb6fde9b47Jon Branch if (entry.getKey() != null && entry.getValue() != null) {
548846fe158900a483ca91f47603c6bb6fde9b47Jon Branch public static JsonValue fromJsonString(String string) {
548846fe158900a483ca91f47603c6bb6fde9b47Jon Branch return string != null && string.length() > 0 ? json(Json.readJson(string)) : null;
548846fe158900a483ca91f47603c6bb6fde9b47Jon Branch public static Boolean booleanFromString(String string) {
548846fe158900a483ca91f47603c6bb6fde9b47Jon Branch } catch (Exception e) {