code: public <T> BinaryValue getRiakBucketType(T obj)
      {
          BinaryValue bucketType = null;
  
          if (riakBucketTypeGetter != null)
          {
              if (riakBucketTypeGetter.getReturnType().isArray())
              {
                  Object o = getMethodValue(riakBucketTypeGetter, obj);
                  if (o != null)
                  {
                      bucketType = BinaryValue.create((byte[]) o);
                  }
              }
              else
              {
                  Object o = getMethodValue(riakBucketTypeGetter, obj);
                  if (o != null)
                  {
                      bucketType = BinaryValue.create((String) o);
                  }
              }
          }
          else if (riakBucketTypeField != null)
          {
              if (riakBucketTypeField.getType().equals(String.class))
              {
                  Object o = getFieldValue(riakBucketTypeField, obj);
                  if (o != null)
                  {
                      bucketType = BinaryValue.create((String) o);
                  }
              }
              else
              {
                  Object o = getFieldValue(riakBucketTypeField, obj);
                  if (o != null)
                  {
                      bucketType = BinaryValue.create((byte[]) o);
                  }
              }
          }
          return bucketType;
      }
docs: TODO: charset in annotation