Class AbstractPojoRawTypeModel<T,I extends PojoBootstrapIntrospector>

java.lang.Object
org.hibernate.search.mapper.pojo.model.spi.AbstractPojoRawTypeModel<T,I>
All Implemented Interfaces:
org.hibernate.search.engine.mapper.model.spi.MappableTypeModel, PojoRawTypeModel<T>, PojoTypeModel<T>
Direct Known Subclasses:
AbstractPojoHCAnnRawTypeModel

public abstract class AbstractPojoRawTypeModel<T,I extends PojoBootstrapIntrospector> extends Object implements PojoRawTypeModel<T>
  • Field Details

  • Constructor Details

    • AbstractPojoRawTypeModel

      public AbstractPojoRawTypeModel(I introspector, PojoRawTypeIdentifier<T> typeIdentifier)
  • Method Details

    • equals

      public final boolean equals(Object o)
      Specified by:
      equals in interface org.hibernate.search.engine.mapper.model.spi.MappableTypeModel
      Specified by:
      equals in interface PojoTypeModel<T>
      Overrides:
      equals in class Object
      Returns:
      true if obj is a PojoTypeModel referencing the exact same type with the exact same exposed metadata.
    • hashCode

      public final int hashCode()
      Specified by:
      hashCode in interface org.hibernate.search.engine.mapper.model.spi.MappableTypeModel
      Specified by:
      hashCode in interface PojoTypeModel<T>
      Overrides:
      hashCode in class Object
    • toString

      public final String toString()
      Specified by:
      toString in interface org.hibernate.search.engine.mapper.model.spi.MappableTypeModel
      Specified by:
      toString in interface PojoTypeModel<T>
      Overrides:
      toString in class Object
      Returns:
      A human-readable description of this type.
    • typeIdentifier

      public final PojoRawTypeIdentifier<T> typeIdentifier()
      Specified by:
      typeIdentifier in interface PojoRawTypeModel<T>
      Returns:
      The identifier for this type.
    • name

      public final String name()
      Specified by:
      name in interface org.hibernate.search.engine.mapper.model.spi.MappableTypeModel
      Specified by:
      name in interface PojoTypeModel<T>
      Returns:
      A human-readable name for this type.
    • mainConstructor

      public final PojoConstructorModel<T> mainConstructor()
      Specified by:
      mainConstructor in interface PojoRawTypeModel<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:
      constructor in interface PojoRawTypeModel<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:
      declaredConstructors in interface PojoRawTypeModel<T>
      Returns:
      All accessible constructors of this type.
    • createDeclaredConstructors

      protected abstract List<PojoConstructorModel<T>> createDeclaredConstructors()
    • property

      public final PojoPropertyModel<?> property(String propertyName)
      Specified by:
      property in interface PojoTypeModel<T>
      Parameters:
      propertyName - The name of a property in this type.
      Returns:
      A representation of the property with the given name.
    • declaredProperties

      public final Collection<PojoPropertyModel<?>> declaredProperties()
      Specified by:
      declaredProperties in interface PojoRawTypeModel<T>
      Returns:
      All declared properties of this type.
    • cast

      public PojoTypeModel<? extends T> cast(PojoTypeModel<?> other)
      Specified by:
      cast in interface PojoRawTypeModel<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 casting List<Integer> to Collection for example would return Collection<Integer>.
    • doCast

      protected PojoTypeModel<? extends T> doCast(PojoTypeModel<?> other)
    • caster

      public final PojoCaster<T> caster()
      Specified by:
      caster in interface PojoRawTypeModel<T>
      Returns:
      A PojoCaster targeting this type.
    • castTo

      public <U> Optional<PojoTypeModel<? extends U>> castTo(Class<U> target)
      Specified by:
      castTo in interface PojoTypeModel<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 casting List<Integer> to Collection for example would return Collection<Integer>.
    • declaredPropertyNames

      protected abstract Stream<String> declaredPropertyNames()
    • createPropertyModel

      protected abstract PojoPropertyModel<?> createPropertyModel(String propertyName)