private static Identity parse(final JsonObject json) {
        final Map<String, String> props = new HashMap<>(json.size());
        final Opt<JsonObject> image = new Opt.Single<>(
            json.getJsonObject("image")
        );
        if (image.has()) {
            props.put(PsGoogle.PICTURE, image.get().getString("url", "#"));
        } else {
            props.put(PsGoogle.PICTURE, "#");
        }
        props.put(
            PsGoogle.NAME, json.getString(PsGoogle.DISPLAY_NAME, "unknown")
        );
        return new Identity.Simple(
            String.format("urn:google:%s", json.getString("id")), props
        );
    }
private static Identity parse ( final JsonObject json ) { final Map < String , String > props = new HashMap < > ( json . size ( ) ) ; final Opt < JsonObject > image = new Opt . Single < > ( json . getJsonObject ( "image" ) ) ; if ( image . has ( ) ) { props . put ( PsGoogle . PICTURE , image . get ( ) . getString ( "url" , "#" ) ) ; } else { props . put ( PsGoogle . PICTURE , "#" ) ; } props . put ( PsGoogle . NAME , json . getString ( PsGoogle . DISPLAY_NAME , "unknown" ) ) ; return new Identity . Simple ( String . format ( "urn:google:%s" , json . getString ( "id" ) ) , props ) ; }
Make identity from JSON object.
@param json JSON received from Google
@return Identity found