Java 8 ParameterizedType - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ParameterizedType class.

This code example shows how to use the following methods: getActualTypeArguments, getOwnerType, getRawType
    public boolean equals(Object obj) { 
        if (this == obj) {
            return true; 
        } else if (obj instanceof ParameterizedType) {
            ParameterizedType that = (ParameterizedType) obj;
            Type thatOwnerType = that.getOwnerType();
            Type thatRawType = that.getRawType();
            return (ownerType == null ? thatOwnerType == null : ownerType.equals(thatOwnerType)) && (rawType == null ? thatRawType == null : rawType.equals(thatRawType)) && Arrays.equals(actualTypeArguments, that.getActualTypeArguments());
        } else { 
            return false; 
        } 
 
    } 
 
    @Override 
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(rawType);
        if (actualTypeArguments.length > 0) {
            sb.append("<");
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getActualTypeArguments, getRawType
			return nameFor(wild.getUpperBounds()[0]);
		} 
	} 
 
	private String nameFor(ParameterizedType type) {
		Class<?> raw = (Class<?>) type.getRawType();
		if (Collection.class.isAssignableFrom(raw)) {
			return nameFor(type.getActualTypeArguments()[0]) + "List";
		} 
		return nameFor(raw);
	} 
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getActualTypeArguments, getOwnerType, getRawType
    public boolean equals(Object obj) { 
        if (this == obj) {
            return true; 
        } else if (obj instanceof ParameterizedType) {
            ParameterizedType that = (ParameterizedType) obj;
            Type thatOwnerType = that.getOwnerType();
            Type thatRawType = that.getRawType();
            return (ownerType == null ? thatOwnerType == null : ownerType.equals(thatOwnerType)) && (rawType == null ? thatRawType == null : rawType.equals(thatRawType)) && Arrays.equals(actualTypeArguments, that.getActualTypeArguments());
        } else { 
            return false; 
        } 
 
    } 
 
    @Override 
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(rawType);
        if (actualTypeArguments.length > 0) {
            sb.append("<");
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getActualTypeArguments
    private final Type type;
    private Locale locale;
 
    public Transformer() { 
        ParameterizedType ptype = (ParameterizedType) getClass().getGenericSuperclass();
        this.type = ptype.getActualTypeArguments()[0];
    } 
 
    @Override 
    public String toString(Object o) {
        return o.toString(); 
    } 
 
    @Override 
    public final Object fromString(String s) {
        return transform(s);
    } 
 
    @Override 
    public boolean canConvert(Class type) {
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getOwnerType, getRawType
    } else if (type instanceof CompositeType) {
      return type;
 
    } else if (type instanceof ParameterizedType) {
      ParameterizedType p = (ParameterizedType) type;
      return new ParameterizedTypeImpl(p.getOwnerType(),
          p.getRawType(), p.getActualTypeArguments());
 
    } else if (type instanceof GenericArrayType) {
      GenericArrayType g = (GenericArrayType) type;
      return new GenericArrayTypeImpl(g.getGenericComponentType());
 
    } else if (type instanceof WildcardType) {
      WildcardType w = (WildcardType) type;
      return new WildcardTypeImpl(w.getUpperBounds(), w.getLowerBounds());
 
    } else { 
      // type is either serializable as-is or unsupported 
      return type;
    } 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 ParameterizedType Questions & Answers:

See Code Examples for Java 8 ParameterizedType Methods: