public static Failure parse ( String failure ) { Failure result = new Failure ( ) ; int dash = failure . indexOf ( ' ' ) ; int leftBracet = failure . indexOf ( ' ' ) ; int rightBracet = failure . indexOf ( ' ' ) ; result . title = failure . substring ( 0 , leftBracet ) . trim ( ) ; result . code = failure . substring ( leftBracet + 1 , rightBracet ) . trim ( ) ; if ( dash > 0 ) { result . details = failure . substring ( dash + 1 ) . trim ( ) ; } return result ; }
Creates a new failure descriptor based on its string presentation .