@Override public ReferenceType withValueHandler(Object h) { if (h == _valueHandler) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType, _anchorType, h, _typeHandler,_asStatic); }
@Override public JavaType withContentType(JavaType contentType) { if (_referencedType == contentType) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, contentType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Override public ReferenceType withTypeHandler(Object h) { if (h == _typeHandler) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType, _anchorType, _valueHandler, h, _asStatic); }
/** * @since 2.7 */ public static ReferenceType construct(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts, JavaType refType) { return new ReferenceType(cls, bindings, superClass, superInts, refType, null, null, null, false); }
@Override public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces) { return new ReferenceType(rawType, _bindings, superClass, superInterfaces, _referencedType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Override @Deprecated // since 2.7 protected JavaType _narrow(Class<?> subclass) { // Should we check that there is a sub-class relationship? return new ReferenceType(subclass, _bindings, _superClass, _superInterfaces, _referencedType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Deprecated // since 2.7 public static ReferenceType construct(Class<?> cls, JavaType refType) { return new ReferenceType(cls, TypeBindings.emptyBindings(), // !!! TODO: missing supertypes null, null, null, refType, null, null, false); }
@Override public ReferenceType withStaticTyping() { if (_asStatic) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType.withStaticTyping(), _anchorType, _valueHandler, _typeHandler, true); }
/** * Factory method that can be used to "upgrade" a basic type into collection-like * one; usually done via {@link TypeModifier} * * @param baseType Resolved non-reference type (usually {@link SimpleType}) that is being upgraded * @param refdType Referenced type; usually the first and only type parameter, but not necessarily * * @since 2.7 */ public static ReferenceType upgradeFrom(JavaType baseType, JavaType refdType) { if (refdType == null) { throw new IllegalArgumentException("Missing referencedType"); } // 19-Oct-2015, tatu: Not sure if and how other types could be used as base; // will cross that bridge if and when need be if (baseType instanceof TypeBase) { return new ReferenceType((TypeBase) baseType, refdType); } throw new IllegalArgumentException("Cannot upgrade from an instance of "+baseType.getClass()); }
@Override public ReferenceType withContentTypeHandler(Object h) { if (h == _referencedType.<Object>getTypeHandler()) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType.withTypeHandler(h), _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Override public ReferenceType withContentValueHandler(Object h) { if (h == _referencedType.<Object>getValueHandler()) { return this; } JavaType refdType = _referencedType.withValueHandler(h); return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, refdType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Override public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces) { return new ReferenceType(rawType, _bindings, superClass, superInterfaces, _referencedType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Override public ReferenceType withTypeHandler(Object h) { if (h == _typeHandler) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType, _anchorType, _valueHandler, h, _asStatic); }
@Override public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces) { return new ReferenceType(rawType, _bindings, superClass, superInterfaces, _referencedType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Override public ReferenceType withValueHandler(Object h) { if (h == _valueHandler) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType, _anchorType, h, _typeHandler,_asStatic); }
@Override public JavaType withContentType(JavaType contentType) { if (_referencedType == contentType) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, contentType, _anchorType, _valueHandler, _typeHandler, _asStatic); }
@Deprecated // since 2.7 public static ReferenceType construct(Class<?> cls, JavaType refType) { return new ReferenceType(cls, TypeBindings.emptyBindings(), // !!! TODO: missing supertypes null, null, null, refType, null, null, false); }
@Override public ReferenceType withStaticTyping() { if (_asStatic) { return this; } return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, _referencedType.withStaticTyping(), _anchorType, _valueHandler, _typeHandler, true); }
@Deprecated // since 2.7 public static ReferenceType construct(Class<?> cls, JavaType refType) { return new ReferenceType(cls, TypeBindings.emptyBindings(), // !!! TODO: missing supertypes null, null, null, refType, null, null, false); }
@Override public ReferenceType withContentValueHandler(Object h) { if (h == _referencedType.<Object>getValueHandler()) { return this; } JavaType refdType = _referencedType.withValueHandler(h); return new ReferenceType(_class, _bindings, _superClass, _superInterfaces, refdType, _anchorType, _valueHandler, _typeHandler, _asStatic); }