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

com.aliyun.tair.tairbloom.factory.BloomBuilderFactory 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.tairbloom.factory;

import redis.clients.jedis.Builder;

import java.util.List;

public class BloomBuilderFactory {

    public static final Builder BFMADD_RESULT_BOOLEAN_LIST = new Builder() {
        @Override
        public Boolean[] build(Object data) {
            if (data == null) {
                return null;
            }
            List l = (List) data;
            Boolean ret[] = new Boolean[l.size()];
            for (int i = 0; i < l.size(); i++) {
                ret[i] = ((Number) l.get(i)).longValue() != 0;
            }
            return ret;
        }

        @Override
        public String toString() {
            return "BfmaddResult";
        }
    };

    public static final Builder BFINSERT_RESULT_BOOLEAN_LIST = new Builder() {
        @Override
        public Boolean[] build(Object data) {
            if (data == null) {
                return null;
            }
            List l = (List) data;
            Boolean ret[] = new Boolean[l.size()];
            for (int i = 0; i < l.size(); i++) {
                ret[i] = ((Number) l.get(i)).longValue() != 0;
            }
            return ret;
        }

        @Override
        public String toString() {
            return "BfinsertResult";
        }
    };
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy