Github user kchilton2 commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/127#discussion_r92820516
  
    --- Diff: 
common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfigurationBuilder.java
 ---
    @@ -0,0 +1,158 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.rya.api;
    +
    +import com.google.common.base.Preconditions;
    +
    +/**
    + * This is a base class meant to be extended by Rya configuration 
builders. Any
    + * class extending this class inherits setter methods that should be 
common to
    + * all Rya implementations.
    + * 
    + * @param <B>
    + *            the configuration builder returned by each of the setter 
methods
    + * @param <C>
    + *            the configuration object returned by the builder when build 
is
    + *            called
    + */
    +public abstract class RdfCloudTripleStoreConfigurationBuilder<B extends 
RdfCloudTripleStoreConfigurationBuilder<B, C>, C extends 
RdfCloudTripleStoreConfiguration> {
    +
    +    private String prefix = "rya_";
    +    private String auths;
    +    private String visibilities;
    +    private boolean useInference = false;
    +    private boolean displayPlan = false;
    +
    +    /**
    +     * Auxiliary method to return specified Builder in a type safe way
    +     * 
    +     * @return specified builder
    +     */
    +    protected abstract B confBuilder();
    +
    +    /**
    +     * Auxiliary method to return type of configuration object constructed 
by
    +     * builder in a type safe way
    +     * 
    +     * @return specified configuration
    +     */
    +    protected abstract C createConf();
    +
    +    /**
    +     * Set whether to use backwards chaining inferencing during query
    +     * evaluation. The default value is false.
    +     * 
    +     * @param useInference
    +     *            - turn inferencing on and off in Rya
    +     * @return B - concrete builder class
    +     */
    +    public B useInference(boolean useInference) {
    +        this.useInference = useInference;
    +        return confBuilder();
    +    }
    +
    +    /**
    +     * 
    +     * Sets the authorization for querying the underlying data store.
    +     * 
    +     * @param auths
    +     *            - authorizations for querying underlying datastore
    +     * @return B - concrete builder class
    +     */
    +    public B auths(String auths) {
    +        Preconditions.checkNotNull(auths, "User auths cannot be null.");
    --- End diff --
    
    These kind of checks should happen when you build the concrete object 
rather than when you're setting values in the builder.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to