private TypeArgSignature getTypeArgSignature ( Type type ) { if ( type instanceof WildcardType ) { WildcardType wildcardType = ( WildcardType ) type ; Type lowerBound = wildcardType . getLowerBounds ( ) . length == 0 ? null : wildcardType . getLowerBounds ( ) [ 0 ] ; Type upperBound = wildcardType . getUpperBounds ( ) . length == 0 ? null : wildcardType . getUpperBounds ( ) [ 0 ] ; if ( lowerBound == null && Object . class . equals ( upperBound ) ) { return new TypeArgSignature ( TypeArgSignature . UNBOUNDED_WILDCARD , ( FieldTypeSignature ) getFullTypeSignature ( upperBound ) ) ; } else if ( lowerBound == null && upperBound != null ) { return new TypeArgSignature ( TypeArgSignature . UPPERBOUND_WILDCARD , ( FieldTypeSignature ) getFullTypeSignature ( upperBound ) ) ; } else if ( lowerBound != null ) { return new TypeArgSignature ( TypeArgSignature . LOWERBOUND_WILDCARD , ( FieldTypeSignature ) getFullTypeSignature ( lowerBound ) ) ; } else { throw new RuntimeException ( "Invalid type" ) ; } } else { return new TypeArgSignature ( TypeArgSignature . NO_WILDCARD , ( FieldTypeSignature ) getFullTypeSignature ( type ) ) ; } }
get the TypeArgSignature corresponding to given type