Class GeometryQueryConverter

  • All Implemented Interfaces:
    SimpleValueConverter

    public class GeometryQueryConverter
    extends TypeConverter
    implements SimpleValueConverter
    Converts Point objects into DBObjects for querying only. When saving entities with Points in, this converter should not be used.
    • Constructor Detail

      • GeometryQueryConverter

        public GeometryQueryConverter​(Mapper mapper)
        Create a new converter. Registers itself to convert Point classes.
        Parameters:
        mapper - the Mapper is required as this converter delegates other type encoding back to the mapper
    • Method Detail

      • decode

        public java.lang.Object decode​(java.lang.Class<?> targetClass,
                                       java.lang.Object fromDBObject,
                                       MappedField optionalExtraInfo)
        Description copied from class: TypeConverter
        decode the DBObject and provide the corresponding java (type-safe) object
        NOTE: optionalExtraInfo might be null
        Specified by:
        decode in class TypeConverter
        Parameters:
        targetClass - the class to create and populate
        fromDBObject - the DBObject to use when populating the new instance
        optionalExtraInfo - the MappedField that contains the metadata useful for decoding
        Returns:
        the new instance
      • encode

        public java.lang.Object encode​(java.lang.Object value,
                                       MappedField optionalExtraInfo)
        Description copied from class: TypeConverter
        encode the (type-safe) java object into the corresponding DBObject
        Overrides:
        encode in class TypeConverter
        Parameters:
        value - The object to encode
        optionalExtraInfo - the MappedField that contains the metadata useful for decoding
        Returns:
        the encoded version of the object