Class AbstractPojoRawTypeModel<T,I extends PojoBootstrapIntrospector>
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.model.spi.AbstractPojoRawTypeModel<T,I>
-
- All Implemented Interfaces:
MappableTypeModel,PojoRawTypeModel<T>,PojoTypeModel<T>
- Direct Known Subclasses:
AbstractPojoHCAnnRawTypeModel,HibernateOrmDynamicMapRawTypeModel
public abstract class AbstractPojoRawTypeModel<T,I extends PojoBootstrapIntrospector> extends Object implements PojoRawTypeModel<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected Iintrospectorprotected PojoRawTypeIdentifier<T>typeIdentifier
-
Constructor Summary
Constructors Constructor Description AbstractPojoRawTypeModel(I introspector, PojoRawTypeIdentifier<T> typeIdentifier)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PojoTypeModel<? extends T>cast(PojoTypeModel<?> other)PojoCaster<T>caster()<U> Optional<PojoTypeModel<? extends U>>castTo(Class<U> target)PojoConstructorModel<T>constructor(Class<?>... parameterTypes)protected abstract List<PojoConstructorModel<T>>createDeclaredConstructors()protected abstract PojoPropertyModel<?>createPropertyModel(String propertyName)Collection<PojoConstructorModel<T>>declaredConstructors()Collection<PojoPropertyModel<?>>declaredProperties()protected abstract Stream<String>declaredPropertyNames()protected PojoTypeModel<? extends T>doCast(PojoTypeModel<?> other)booleanequals(Object o)inthashCode()PojoConstructorModel<T>mainConstructor()Stringname()PojoPropertyModel<?>property(String propertyName)StringtoString()PojoRawTypeIdentifier<T>typeIdentifier()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.engine.mapper.model.spi.MappableTypeModel
isAbstract, isSubTypeOf
-
Methods inherited from interface org.hibernate.search.mapper.pojo.model.spi.PojoRawTypeModel
annotations, ascendingSuperTypes, descendingSuperTypes, rawType
-
Methods inherited from interface org.hibernate.search.mapper.pojo.model.spi.PojoTypeModel
arrayElementType, typeArgument
-
-
-
-
Field Detail
-
introspector
protected final I extends PojoBootstrapIntrospector introspector
-
typeIdentifier
protected final PojoRawTypeIdentifier<T> typeIdentifier
-
-
Constructor Detail
-
AbstractPojoRawTypeModel
public AbstractPojoRawTypeModel(I introspector, PojoRawTypeIdentifier<T> typeIdentifier)
-
-
Method Detail
-
equals
public final boolean equals(Object o)
- Specified by:
equalsin interfaceMappableTypeModel- Overrides:
equalsin classObject- Returns:
trueifobjis aMappableTypeModelreferencing the exact same type with the exact same exposed metadata.
-
hashCode
public final int hashCode()
- Specified by:
hashCodein interfaceMappableTypeModel- Overrides:
hashCodein classObject
-
toString
public final String toString()
- Specified by:
toStringin interfaceMappableTypeModel- Overrides:
toStringin classObject- Returns:
- A human-readable description of this type.
-
typeIdentifier
public final PojoRawTypeIdentifier<T> typeIdentifier()
- Specified by:
typeIdentifierin interfacePojoRawTypeModel<T>- Returns:
- The identifier for this type.
-
name
public final String name()
- Specified by:
namein interfaceMappableTypeModel- Specified by:
namein interfacePojoTypeModel<T>- Returns:
- A human-readable name for this type.
-
mainConstructor
public final PojoConstructorModel<T> mainConstructor()
- Specified by:
mainConstructorin interfacePojoRawTypeModel<T>- Returns:
- The main constructor of this type. The main constructor only exists if this type defines a single constructor.
-
constructor
public final PojoConstructorModel<T> constructor(Class<?>... parameterTypes)
- Specified by:
constructorin interfacePojoRawTypeModel<T>- Parameters:
parameterTypes- The type of parameters to the returned constructor.- Returns:
- The constructor of this type whose parameters have the given
parameterTypes.
-
declaredConstructors
public Collection<PojoConstructorModel<T>> declaredConstructors()
- Specified by:
declaredConstructorsin interfacePojoRawTypeModel<T>- Returns:
- All accessible constructors of this type.
-
createDeclaredConstructors
protected abstract List<PojoConstructorModel<T>> createDeclaredConstructors()
-
property
public final PojoPropertyModel<?> property(String propertyName)
- Specified by:
propertyin interfacePojoTypeModel<T>- Parameters:
propertyName- The name of apropertyin this type.- Returns:
- A representation of the property with the given name.
-
declaredProperties
public final Collection<PojoPropertyModel<?>> declaredProperties()
- Specified by:
declaredPropertiesin interfacePojoRawTypeModel<T>- Returns:
- All declared properties of this type.
-
cast
public PojoTypeModel<? extends T> cast(PojoTypeModel<?> other)
- Specified by:
castin interfacePojoRawTypeModel<T>- Parameters:
other- The type to cast to this type.- Returns:
- A new type model, representing the given type cast to this type.
If casting is not possible, returns
this. If casting is possible, the returned type model will retain as much contextual type information as possible (type arguments, ...), so castingList<Integer>toCollectionfor example would returnCollection<Integer>.
-
doCast
protected PojoTypeModel<? extends T> doCast(PojoTypeModel<?> other)
-
caster
public final PojoCaster<T> caster()
- Specified by:
casterin interfacePojoRawTypeModel<T>- Returns:
- A
PojoCastertargeting this type.
-
castTo
public <U> Optional<PojoTypeModel<? extends U>> castTo(Class<U> target)
- Specified by:
castToin interfacePojoTypeModel<T>- Type Parameters:
U- The type to cast to.- Parameters:
target- The type to cast to.- Returns:
- A new type model, representing the current type cast to the given type,
or
Optional.empty()if casting is not supported. The type model will retain as much contextual type information as possible (type arguments, ...), so castingList<Integer>toCollectionfor example would returnCollection<Integer>.
-
createPropertyModel
protected abstract PojoPropertyModel<?> createPropertyModel(String propertyName)
-
-