Package com.trifork.riak

Source Code of com.trifork.riak.BucketProperties

package com.trifork.riak;

import com.trifork.riak.RPB.RpbBucketProps;
import com.trifork.riak.RPB.RpbGetBucketResp;
import com.trifork.riak.RPB.RpbBucketProps.Builder;

public class BucketProperties {

  private Boolean allowMult;
  private Integer nValue;

  public void init(RpbGetBucketResp resp) {
    if (resp.hasProps()) {
     
      RpbBucketProps props = resp.getProps();
      if (props.hasAllowMult()) {
        allowMult = Boolean.valueOf(props.getAllowMult());
      }
      if (props.hasNVal()) {
        nValue = new Integer(props.getNVal());
      }
    }
  }
 
  public Boolean getAllowMult() {
    return allowMult;
  }
 
  public Integer getNValue() {
    return nValue;
  }
 
  public BucketProperties allowMult(boolean val) {
    this.allowMult = val;
    return this;
  }

  public BucketProperties nValue(int val) {
    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();
  }

}
TOP

Related Classes of com.trifork.riak.BucketProperties

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.