public static boolean isDefaultValue ( CamelCatalog camelCatalog , String scheme , String key , String value ) { // use the camel catalog String json = camelCatalog . componentJSonSchema ( scheme ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for component name: " + scheme ) ; } List < Map < String , String > > data = JSonSchemaHelper . parseJsonSchema ( "properties" , json , true ) ; if ( data != null ) { for ( Map < String , String > propertyMap : data ) { String name = propertyMap . get ( "name" ) ; String defaultValue = propertyMap . get ( "defaultValue" ) ; if ( key . equals ( name ) ) { return value . equalsIgnoreCase ( defaultValue ) ; } } } return false ; }
Checks whether the given value is matching the default value from the given component .