com.aerospike.client.Value.getAsNull()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中com.aerospike.client.Value.getAsNull()方法的一些代码示例,展示了Value.getAsNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getAsNull()方法的具体详情如下:
包路径:com.aerospike.client.Value
类名称:Value
方法名:getAsNull

Value.getAsNull介绍

[英]Get null value instance.
[中]获取空值实例。

代码示例

代码示例来源:origin: com.aerospike/aerospike-client

private Operation(Type type) {
    this.type = type;
    this.binName = null;
    this.value = Value.getAsNull();
  }
}

代码示例来源:origin: aerospike/aerospike-client-java

private Operation(Type type) {
    this.type = type;
    this.binName = null;
    this.value = Value.getAsNull();
  }
}

代码示例来源:origin: com.aerospike/aerospike-client

private Operation(Type type, String binName) {
  this.type = type;
  this.binName = binName;
  this.value = Value.getAsNull();
}

代码示例来源:origin: aerospike/aerospike-client-java

private Operation(Type type, String binName) {
  this.type = type;
  this.binName = binName;
  this.value = Value.getAsNull();
}

代码示例来源:origin: com.aerospike/aerospike-client

/**
 * Create bin with a null value. This is useful for bin deletions within a record.
 * For servers configured as "single-bin", enter a null or empty name.
 *
 * @param name        bin name, current limit is 14 characters
 */
public static Bin asNull(String name) {
  return new Bin(name, Value.getAsNull());
}

代码示例来源:origin: aerospike/aerospike-client-java

/**
 * Create bin with a null value. This is useful for bin deletions within a record.
 * For servers configured as "single-bin", enter a null or empty name.
 *
 * @param name        bin name, current limit is 14 characters
 */
public static Bin asNull(String name) {
  return new Bin(name, Value.getAsNull());
}

代码示例来源:origin: aerospike/aerospike-client-java

end.add(Value.getAsNull());

代码示例来源:origin: aerospike/aerospike-client-java

private static Value genValue(RandomShift random, DBObjectSpec spec, long keySeed) {
    switch (spec.type) {
    case 'I':
      if (keySeed == -1) {
        return Value.get(random.nextInt());
      } else {
        return Value.get(keySeed);
      }
      
    case 'B':
      byte[] ba = new byte[spec.size];
      random.nextBytes(ba);
      return Value.get(ba);
        
    case 'S':
      StringBuilder sb = new StringBuilder(spec.size);
      for (int i = 0; i < spec.size; i++) {
        // Append ascii value between ordinal 33 and 127.
        sb.append((char)(random.nextInt(94) + 33));
      }
      return Value.get(sb.toString());
      
    case 'D':
      return Value.get(System.currentTimeMillis());
      
    default:
      return Value.getAsNull();
    }
  }    
}

代码示例来源:origin: aerospike/aerospike-client-java

protected static Operation createRangeOperation(int command, Operation.Type type, String binName, Value begin, Value end, int returnType) {
    Packer packer = new Packer();
    packer.packRawShort(command);
    
    if (begin == null) {
      begin = Value.getAsNull();
    }
    
    if (end == null) {
      packer.packArrayBegin(2);
      packer.packInt(returnType);
      begin.pack(packer);        
    }
    else {
      packer.packArrayBegin(3);
      packer.packInt(returnType);
      begin.pack(packer);        
      end.pack(packer);        
    }
    return new Operation(type, binName, Value.get(packer.toByteArray()));
  }
}

代码示例来源:origin: com.aerospike/aerospike-client

protected static Operation createRangeOperation(int command, Operation.Type type, String binName, Value begin, Value end, int returnType) {
    Packer packer = new Packer();
    packer.packRawShort(command);

    if (begin == null) {
      begin = Value.getAsNull();
    }

    if (end == null) {
      packer.packArrayBegin(2);
      packer.packInt(returnType);
      begin.pack(packer);
    }
    else {
      packer.packArrayBegin(3);
      packer.packInt(returnType);
      begin.pack(packer);
      end.pack(packer);
    }
    return new Operation(type, binName, Value.get(packer.toByteArray()));
  }
}

相关文章

微信公众号

最新文章

更多