Class MappingModel.TransformationSearchResult

    • Method Detail

      • hasResult

        public boolean hasResult()
        Returns:
        Returns true if the search has a result, false otherwise.
      • hasSingleResult

        public boolean hasSingleResult()
        Returns:
        Returns true if the search has exactly one result, false otherwise.
      • hasMultipleResults

        public boolean hasMultipleResults()
        Returns:
        Returns true if the search has multiple results, false otherwise.
      • isValueTransformation

        public boolean isValueTransformation()
        Checks if the matching transformation is a value transformation. Note: There are also transformations that use the whole source object for mapping. In this case use isObjectTransformation() to determine source object transformations. This method expects a single search result, use hasSingleResult() before calling this method.
        Returns:
        Returns true if the transformation expects a single field value, otherwise false is returned.
      • isObjectTransformation

        public boolean isObjectTransformation()
        Checks if the matching transformation is a source object transformation. This method expects a single search result, use hasSingleResult() before calling this method.
        Returns:
        Returns true if the transformation expects the whole source object for mapping, otherwise false is returned.
      • isDelegatingTransformation

        public boolean isDelegatingTransformation()
        Checks if this transformation is likely to delegate to nested mappers. Note: This method expects a single search result, use hasSingleResult() before calling this method.
        Returns:
        Returns true if the transformation will delegate to nested mappers, otherwise false is returned.
      • hasMapperFor

        public boolean hasMapperFor​(Class<?> sourceType,
                                    Class<?> targetType)
        Checks if the mapping configuration has a mapper registered for the specified type mapping.
        Parameters:
        sourceType - The source type.
        targetType - The destination type.
        Returns:
        Returns true if the mapping configuration has a mapper for the specified type mapping, otherwise false is returned.
      • getMapperFor

        public Mapper<?,​?> getMapperFor​(Class<?> sourceType,
                                              Class<?> destinationType)
        Returns a Mapper if the specified type mapping was registered on the mapper.
        Parameters:
        sourceType - The source type.
        destinationType - The destination type.
        Returns:
        Returns a Mapper if registered.
        Throws:
        IllegalStateException - If the mapper cannot be found. To avoid this, check with hasMapperFor(Class, Class) before.
      • performValueTransformation

        public MappedResult performValueTransformation​(Object value)
        Performs a value transformation. This method expects a single search result, use hasSingleResult() before calling this method.
        Parameters:
        value - The value to map. Use isObjectTransformation() to determine which input value is to be used.
        Returns:
        Returns the MappedResult.
      • getSourcePropertyName

        public String getSourcePropertyName()
        Returns:
        Returns the source property name.
      • getDestinationPropertyName

        public String getDestinationPropertyName()
        Returns:
        Returns the destination property name.
      • getSource

        public PropertyDescriptor getSource()
        Returns:
        Returns the source property descriptor.
      • getDestination

        public PropertyDescriptor getDestination()
        Returns:
        Returns the destination property descriptor.