use of com.hazelcast.internal.ascii.rest.RestValue in project hazelcast by hazelcast.
the class TextProtocolsDataSerializerHook method createFactory.
@Override
public DataSerializableFactory createFactory() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[MEMCACHE_ENTRY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new MemcacheEntry();
}
};
constructors[REST_VALUE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new RestValue();
}
};
return new ArrayDataSerializableFactory(constructors);
}
use of com.hazelcast.internal.ascii.rest.RestValue in project hazelcast by hazelcast.
the class TextCommandServiceImpl method getByteArray.
@Override
public byte[] getByteArray(String mapName, String key) {
Object value = hazelcast.getMap(mapName).get(key);
byte[] result = null;
if (value != null) {
if (value instanceof RestValue) {
RestValue restValue = (RestValue) value;
result = restValue.getValue();
} else if (value instanceof byte[]) {
result = (byte[]) value;
} else {
result = toByteArray(value);
}
}
return result;
}
Aggregations