Examples of Builder


Examples of com.basho.riak.pbc.RPB.RpbBucketProps.Builder

    this.nValue = val;
    return this;
  }

  RpbBucketProps build() {
    Builder builder = RpbBucketProps.newBuilder();
    if (allowMult != null) {
      builder.setAllowMult(allowMult);
    }
    if (nValue != null) {
      builder.setNVal(nValue);
    }
    return builder.build();
  }
View Full Code Here

Examples of com.basho.riak.pbc.RPB.RpbContent.Builder

    public ByteString getValue(){
        return value;
    }

  RpbContent buildContent() {
    Builder b =
      RpbContent.newBuilder()
        .setValue(value);
   
    if (contentType != null) {
      b.setContentType(ByteString.copyFromUtf8(contentType));
    }
       
    if (charset != null) {
      b.setCharset(ByteString.copyFromUtf8(charset));
    }
       
    if (contentEncoding != null) {
      b.setContentEncoding(ByteString.copyFromUtf8(contentEncoding));
    }

    if (vtag != null) {
      b.setVtag(ByteString.copyFromUtf8(vtag));
    }
   
        if (links.size() != 0) {
            RiakLink[] localLinks = null;
            synchronized (links) {
                localLinks = links.toArray(new RiakLink[links.size()]);
            }
            for (RiakLink l : localLinks) {
                b.addLinks(l.build());
            }
        }
   
    if (lastModified != null) {
      b.setLastMod(lastModified);
    }
   
    if (lastModifiedUsec != null) {
      b.setLastModUsecs(lastModifiedUsec);
    }
   
    if (userMeta != null && !userMeta.isEmpty()) {
      for (Map.Entry<String, String> ent : userMeta.entrySet()) {
        ByteString key = ByteString.copyFromUtf8(ent.getKey());
        com.basho.riak.pbc.RPB.RpbPair.Builder pb = RPB.RpbPair.newBuilder().setKey(key);
        if (ent.getValue() != null) {
          pb.setValue(ByteString.copyFromUtf8(ent.getValue()));
        }
        b.addUsermeta(pb);
      }
    }
   
    return b.build();
  }
View Full Code Here

Examples of com.basho.riak.pbc.RPB.RpbLink.Builder

  public ByteString getTag() {
    return tag;
  }

  public RpbLink build() {
    Builder b = RpbLink.newBuilder();
   
    if (bucket != null)
      b.setBucket(bucket);
   
    if (key != null)
      b.setKey(key);
   
    if (tag != null)
      b.setTag(tag);

    return b.build();
  }
View Full Code Here

Examples of com.basho.riak.protobuf.RiakKvPB.RpbBucketProps.Builder

    this.nValue = val;
    return this;
  }

  RpbBucketProps build() {
    Builder builder = RpbBucketProps.newBuilder();
    if (allowMult != null) {
      builder.setAllowMult(allowMult);
    }
    if (nValue != null) {
      builder.setNVal(nValue);
    }
    return builder.build();
  }
View Full Code Here

Examples of com.basho.riak.protobuf.RiakKvPB.RpbContent.Builder

    public ByteString getValue(){
        return value;
    }

  RpbContent buildContent() {
    Builder b =
      RpbContent.newBuilder()
        .setValue(value);
   
    if (contentType != null) {
      b.setContentType(ByteString.copyFromUtf8(contentType));
    }
       
    if (charset != null) {
      b.setCharset(ByteString.copyFromUtf8(charset));
    }
       
    if (contentEncoding != null) {
      b.setContentEncoding(ByteString.copyFromUtf8(contentEncoding));
    }

    if (vtag != null) {
      b.setVtag(ByteString.copyFromUtf8(vtag));
    }
   
        if (links.size() != 0) {
            RiakLink[] localLinks = null;
            synchronized (links) {
                localLinks = links.toArray(new RiakLink[links.size()]);
            }
            for (RiakLink l : localLinks) {
                b.addLinks(l.build());
            }
        }
   
    if (lastModified != null) {
      b.setLastMod(lastModified);
    }
   
    if (lastModifiedUsec != null) {
      b.setLastModUsecs(lastModifiedUsec);
    }
   
    final Map<String, String> tmpUserMetaData = new LinkedHashMap<String, String>();

    synchronized (userMetaDataLock) {
        tmpUserMetaData.putAll(userMetaData);
        }

    if (tmpUserMetaData != null && !tmpUserMetaData.isEmpty()) {
      for (Map.Entry<String, String> ent : tmpUserMetaData.entrySet()) {
        ByteString key = ByteString.copyFromUtf8(ent.getKey());
        com.basho.riak.protobuf.RiakPB.RpbPair.Builder pb =
                    com.basho.riak.protobuf.RiakPB.RpbPair.newBuilder().setKey(key);
        if (ent.getValue() != null) {
          pb.setValue(ByteString.copyFromUtf8(ent.getValue()));
        }
        b.addUsermeta(pb);
      }
    }

        synchronized (indexLock) {
            for (@SuppressWarnings("rawtypes") RiakIndex i : indexes) {
                b.addIndexes(RpbPair.newBuilder()
                             .setKey(ByteString.copyFromUtf8(i.getName()))
                             .setValue(ByteString.copyFromUtf8(i.getValue().toString()))
                             .build());
            }
        }

    return b.build();
  }
View Full Code Here

Examples of com.basho.riak.protobuf.RiakKvPB.RpbLink.Builder

  public ByteString getTag() {
    return tag;
  }

  public RpbLink build() {
    Builder b = RpbLink.newBuilder();
   
    if (bucket != null)
      b.setBucket(bucket);
   
    if (key != null)
      b.setKey(key);
   
    if (tag != null)
      b.setTag(tag);

    return b.build();
  }
View Full Code Here

Examples of com.basho.riak.protobuf.RiakPB.RpbBucketProps.Builder

  }

   
   
  RpbBucketProps build() {
    Builder builder = RpbBucketProps.newBuilder();
    if (allowMult != null) {
      builder.setAllowMult(allowMult);
    }
    if (nValue != null) {
      builder.setNVal(nValue);
    }
       
        if (lastWriteWins != null) {
            builder.setLastWriteWins(lastWriteWins);
        }
       
        if (backend != null) {
            builder.setBackend(ByteString.copyFromUtf8(backend));
        }
       
        if (smallVClock != null) {
            builder.setSmallVclock(smallVClock);
        }
       
        if (bigVClock != null) {
            builder.setBigVclock(bigVClock);
        }
       
        if (youngVClock != null) {
            builder.setYoungVclock(youngVClock.intValue());
        }
       
        if (oldVClock != null) {
            builder.setOldVclock(oldVClock.intValue());
        }
       
        if (r != null) {
            builder.setR(r);
        }
       
        if (w != null) {
            builder.setW(w);
        }
       
        if (rw != null) {
            builder.setRw(rw);
        }
       
        if (dw != null) {
            builder.setDw(dw);
        }
       
        if (pr != null) {
            builder.setPr(pr);
        }
       
        if (pw != null) {
            builder.setPw(pw);
        }
       
        if (basicQuorum != null) {
            builder.setBasicQuorum(basicQuorum);
        }
       
        if (notFoundOk != null) {
            builder.setNotfoundOk(notFoundOk);
        }
       
        if (searchEnabled != null) {
            builder.setSearch(searchEnabled);
        }
       
        if (precommitHooks.size() > 0) {
            builder.addAllPrecommit(convertHooks(precommitHooks));
        }
       
        if (postcommitHooks.size() > 0) {
            builder.addAllPostcommit(convertHooks(postcommitHooks));
        }
       
        if (cHashFun != null) {
            builder.setChashKeyfun(convertModFun(cHashFun));
        }
       
        if (linkFun != null) {
            builder.setLinkfun(convertModFun(linkFun));
        }
       
    return builder.build();
  }
View Full Code Here

Examples of com.carmatechnologies.commons.jmx.MBeans.Builder

  public JmxConcurrentMap(final ConcurrentMap<K, V> concurrentMap) throws InstanceAlreadyExistsException, MBeanRegistrationException,
      NotCompliantMBeanException, MalformedObjectNameException {
    checkNotNull(concurrentMap, "Concurrent map must NOT be null in order to be JMX-decorated.");
    this.map = concurrentMap;
    final Builder builder = new Builder(this);
    this.objectName = new ObjectName(builder.objectName());
    MBeans.register(builder);
  }
View Full Code Here

Examples of com.codahale.metrics.CsvReporter.Builder

          reporters = Maps.newHashMap();
          REGISTRIES.put(registry, reporters);
        }
        CsvReporter reporter = reporters.get(outputDir);
        if (reporter == null) {
          Builder reporterBuilder = CsvReporter.forRegistry(registry)
              .filter(filter)
              .convertDurationsTo(defaultDurationUnit)
              .convertRatesTo(defaultRateUnit)
              .formatFor(locale);
             
          reporter = reporterBuilder.build(outputDir);
          outputDir.mkdirs();
          if (!outputDir.isDirectory()) {
            throw new MorphlineCompilationException("Directory not found: " + outputDir, config);
          }
          if (!outputDir.canWrite()) {
View Full Code Here

Examples of com.codahale.metrics.JmxReporter.Builder

          reporters = Maps.newHashMap();
          REGISTRIES.put(registry, reporters);
        }
        JmxReporter reporter = reporters.get(domain);
        if (reporter == null) {
          Builder reporterBuilder = JmxReporter.forRegistry(registry)
              .filter(filter)
              .convertDurationsTo(defaultDurationUnit)
              .convertRatesTo(defaultRateUnit)
              .specificDurationUnits(durationUnits)
              .specificRateUnits(rateUnits)
              .inDomain(domain);
         
          reporter = reporterBuilder.build();
          reporter.start();
          reporters.put(domain, reporter);
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.