public static SystemInputDef asSystemInputDef ( JsonObject json ) { String systemName = json . getString ( SYSTEM_KEY ) ; try { SystemInputDef systemInputDef = new SystemInputDef ( validIdentifier ( systemName ) ) ; // Get system annotations Optional . ofNullable ( json . getJsonObject ( HAS_KEY ) ) . ifPresent ( has -> has . keySet ( ) . stream ( ) . forEach ( key -> systemInputDef . setAnnotation ( key , has . getString ( key ) ) ) ) ; // Get system functions json . keySet ( ) . stream ( ) . filter ( key -> ! ( key . equals ( SYSTEM_KEY ) || key . equals ( HAS_KEY ) ) ) . forEach ( function -> systemInputDef . addFunctionInputDef ( asFunctionInputDef ( function , json . getJsonObject ( function ) ) ) ) ; return systemInputDef ; } catch ( SystemInputException e ) { throw new SystemInputException ( String . format ( "Error defining system=%s" , systemName ) , e ) ; } }
Returns the SystemInputDef represented by the given JSON object .