pub fn parse(signature: &'a str) -> Option<JavaType<'a>> {
        match signature.len() {
            0 => None,
            1 => match &*signature {
                "B" => Some(JavaType::Byte),
                "C" => Some(JavaType::Char),
                "D" => Some(JavaType::Double),
                "F" => Some(JavaType::Float),
                "I" => Some(JavaType::Int),
                "J" => Some(JavaType::Long),
                "S" => Some(JavaType::Short),
                "V" => Some(JavaType::Void),
                "Z" => Some(JavaType::Boolean),
                _ => None
            },
            _ => {
                match signature.chars().nth(0).unwrap() {
                    '[' => {
                        let (_, local_type) = signature.split_at(1);

                        match JavaType::parse(local_type) {
                            Some(result) => Some(JavaType::Array(Box::new(result))),
                            None => None
                        }
                    },
                    'L' => Some(JavaType::Class(signature)),
                    _ => None
                }
            }
        }
    }
/// Convert a given type signature into a JavaType instance (if possible). None is returned
/// if the conversation was not successful.

Convert a given type signature into a JavaType instance (if possible). None is returned
if the conversation was not successful.
Convert a given type signature into a JavaType instance ( if possible ) . None is returned if the conversation was not successful .
pub fn parse(signature: &'a str) -> Option<JavaType<'a>> {
        match signature.len() {
            0 => None,
            1 => match &*signature {
                "B" => Some(JavaType::Byte),
                "C" => Some(JavaType::Char),
                "D" => Some(JavaType::Double),
                "F" => Some(JavaType::Float),
                "I" => Some(JavaType::Int),
                "J" => Some(JavaType::Long),
                "S" => Some(JavaType::Short),
                "V" => Some(JavaType::Void),
                "Z" => Some(JavaType::Boolean),
                _ => None
            },
            _ => {
                match signature.chars().nth(0).unwrap() {
                    '[' => {
                        let (_, local_type) = signature.split_at(1);
                        match JavaType::parse(local_type) {
                            Some(result) => Some(JavaType::Array(Box::new(result))),
                            None => None
                        }
                    },
                    'L' => Some(JavaType::Class(signature)),
                    _ => None
                }
            }
        }
    }
pub fn parse ( signature : & ' a str ) -> Option < JavaType < ' a > > { match signature . len ( ) { 0 => None , 1 => match & * signature { " " => Some ( JavaType :: Byte ) , " " => Some ( JavaType :: Char ) , " " => Some ( JavaType :: Double ) , " " => Some ( JavaType :: Float ) , " " => Some ( JavaType :: Int ) , " " => Some ( JavaType :: Long ) , " " => Some ( JavaType :: Short ) , " " => Some ( JavaType :: Void ) , " " => Some ( JavaType :: Boolean ) , _ => None } , _ => { match signature . chars ( ) . nth ( 0 ) . unwrap ( ) { '[' => { let ( _ , local_type ) = signature . split_at ( 1 ) ; match JavaType :: parse ( local_type ) { Some ( result ) => Some ( JavaType :: Array ( Box :: new ( result ) ) ) , None => None } } , 'L' => Some ( JavaType :: Class ( signature ) ) , _ => None } } } }
Convert a given type signature into a JavaType instance (if possible).
Convert a given type signature into a JavaType instance ( if possible ) .
signature
&'a str
signature
&'a str