protected String getCrid ( Map result ) { HashMap mgnData = getObjectOr ( result , "management" , new HashMap ( ) ) ; ArrayList < HashMap > events = getObjectOr ( mgnData , "events" , new ArrayList ( ) ) ; String crid = null ; boolean isPlEventExist = false ; for ( HashMap event : events ) { if ( "planting" . equals ( event . get ( "event" ) ) ) { isPlEventExist = true ; if ( crid == null ) { crid = ( String ) event . get ( "crid" ) ; } else if ( ! crid . equals ( event . get ( "crid" ) ) ) { return "SQ" ; } } } if ( crid == null ) { crid = getValueOr ( result , "crid" , "XX" ) ; } if ( ! isPlEventExist && "XX" . equals ( crid ) ) { return "FA" ; } else { // DssatCRIDHelper crids = new DssatCRIDHelper(); return DssatCRIDHelper . get2BitCrid ( crid ) ; } }
Get crop id with 2 - bit format