title: How to get value of parent node as string?
body: <p><a href="https://i.stack.imgur.com/U0NdK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U0NdK.png" alt="Firebase image"></a></p>
  
  <p>So in the above data structure, I want to get value <code>Aprilia Caponord 1200</code> (marked in fig.). I have Firebase reference to <code>Aprilia</code> (root node) and I can get all the key/value pair data. </p>
  
  <p>Here's my code</p>
  
  <pre><code>@override
  public void onDataChange(DataSnapshot dataSnapshot) {
  for (DataSnapshot child : dataSnapshot.getChild()) {
      Map&lt;?, ?&gt; value = (Map&lt;?, ?&gt;) child.getValue();
      String bike_price = value.get("price").toString();
      String image_url = value.get("image_url").toString();
      }
  }
  </code></pre>
  
  <p>So clearly I can get all the values of child nodes having key/value relations. But I can't specifically get the name of the parent node. So how can I get the value of parent node in <code>String</code> format?</p>
  
  <p>If I print <code>child.getValue().toString()</code>, I get JSON value, but I am not interested in parsing JSON. Is there any specific way to get parent node value?</p>
  
  <pre><code>{Aprilia Caponord 1200={image_url=____________, price=18.35}.. }
  </code></pre>