All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.tair.tairsearch.params.TFTAddDocParams Maven / Gradle / Ivy

Go to download

Aliyun Tair Redis client for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

There is a newer version: 3.0.9
Show newest version
package com.aliyun.tair.tairsearch.params;

import java.util.ArrayList;
import java.util.Map;

import redis.clients.jedis.util.SafeEncoder;

public class TFTAddDocParams {
    public byte[][] getByteParams(String key, Map docs) {
        ArrayList byteParams = new ArrayList();

        byteParams .add(SafeEncoder.encode(key));

        for (Map.Entry entry : docs.entrySet()) {
            byteParams.add(SafeEncoder.encode(entry.getKey()));
            byteParams.add(SafeEncoder.encode(entry.getValue()));
        }

        return byteParams.toArray(new byte[byteParams.size()][]);
    }

    public byte[][] getByteParams(byte[] key, Map docs) {
        ArrayList byteParams = new ArrayList();

        byteParams .add(key);

        for (Map.Entry entry : docs.entrySet()) {
            byteParams.add(entry.getKey());
            byteParams.add(entry.getValue());
        }
        return byteParams.toArray(new byte[byteParams.size()][]);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy