Giriş
Şu satırı dahil ederiz
import com.hazelcast.core.HazelcastJsonValue;
Açıklaması şöyle
Using HazelcastJsonValue means we are still storing data as JSON-formatted Strings.
constructor - Json String
Örnek
Şöyle yaparız
String person1 = "{ \"name\": \"John\", \"age\": 35 }"; String person2 = "{ \"name\": \"Jane\", \"age\": 24 }"; String person3 = "{ \"name\": \"Trey\", \"age\": 17 }"; String person4 = "{ \"name\": \"Phil\", \"age\": 30 }"; String person5 = "{ \"name\": \"May\"}"; IMap<Integer, HazelcastJsonValue> idPersonMap = instance.getMap("jsonValues"); idPersonMap.put(1, new HazelcastJsonValue(person1)); idPersonMap.put(2, new HazelcastJsonValue(person2)); idPersonMap.put(3, new HazelcastJsonValue(person3)); idPersonMap.put(4, new HazelcastJsonValue(person4)); idPersonMap.put(5, new HazelcastJsonValue(person4));
Hiç yorum yok:
Yorum Gönder