Class JsonDocumentResult


public class JsonDocumentResult extends DocumentResult<Map<String,Object>>
Represents entity returns for find() queries working with shemaless documents.
  • Field Details

    • jsonRawData

      protected Map<String,Object> jsonRawData
      Output as a map (to use JsonAySetter annotation).
  • Constructor Details

    • JsonDocumentResult

      public JsonDocumentResult()
      Default constructor.
  • Method Details

    • getSimilarity

      public Float getSimilarity()
      For a schemaless document you might want to overrride.
      Returns:
      similarity
    • getData

      public Map<String,Object> getData()
      Access internal data.
      Returns:
      map of object
    • getList

      public <K> List<K> getList(String k, Class<K> itemClass)
      Return an Array of items.
      Type Parameters:
      K - type of item
      Parameters:
      k - key
      itemClass - expected class
      Returns:
      list of items
    • getArray

      public <K> K[] getArray(String k, Class<K> itemClass)
      Return an Array of items.
      Type Parameters:
      K - type of item
      Parameters:
      k - key
      itemClass - expected class
      Returns:
      list of items
    • getObject

      public <T> T getObject(String k, Class<T> type)
      Access element from the map.
      Type Parameters:
      T - type f parameters
      Parameters:
      k - current configuration key
      type - type of elements
      Returns:
      configuration value
    • getString

      public String getString(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getDouble

      public Double getDouble(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getInteger

      public Integer getInteger(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getBoolean

      public Boolean getBoolean(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getUUID

      public UUID getUUID(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getFloat

      public Float getFloat(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getLong

      public Long getLong(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getShort

      public Short getShort(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getByte

      public Byte getByte(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getCharacter

      public Character getCharacter(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getDate

      public Date getDate(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getCalendar

      public Calendar getCalendar(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getInstant

      public Instant getInstant(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • isAttributeExist

      public boolean isAttributeExist(String key)
      Access element from the map
      Parameters:
      key - current configuration key
      Returns:
      if key exists