コード例 #1
0
    private RiakPB.RpbCommitHook convertHook(Function hook) {
      RiakPB.RpbCommitHook.Builder builder = RiakPB.RpbCommitHook.newBuilder();
      RiakPB.RpbModFun.Builder mfBuilder = RiakPB.RpbModFun.newBuilder();

      if (hook.isJavascript()) {
        builder.setName(ByteString.copyFromUtf8(hook.getName()));
      } else {
        mfBuilder.setModule(ByteString.copyFromUtf8(hook.getModule()));
        mfBuilder.setFunction(ByteString.copyFromUtf8(hook.getFunction()));
        builder.setModfun(mfBuilder);
      }

      return builder.build();
    }
コード例 #2
0
 private RiakPB.RpbModFun convertModFun(Function f) {
   return RiakPB.RpbModFun.newBuilder()
       .setModule(ByteString.copyFromUtf8(f.getModule()))
       .setFunction(ByteString.copyFromUtf8(f.getFunction()))
       .build();
 }