Github user kchilton2 commented on a diff in the pull request:
https://github.com/apache/incubator-rya/pull/36#discussion_r59209306
--- Diff:
extras/indexing/src/main/java/mvm/rya/indexing/accumulo/VisibilityBindingSet.java
---
@@ -0,0 +1,90 @@
+/*
+ * 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 mvm.rya.indexing.accumulo;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import org.openrdf.query.BindingSet;
+
+import mvm.rya.indexing.external.BindingSetDecorator;
+
+/**
+ * Decorates a {@link BindingSet} with a collection of visibilities.
+ */
+@ParametersAreNonnullByDefault
+public class VisibilityBindingSet extends BindingSetDecorator {
+ private static final long serialVersionUID = 1L;
+ private final String visibility;
+ private volatile int hashCode;
+
+ /**
+ * @param set - Decorates the {@link BindingSet} with no visibilities.
+ */
+ public VisibilityBindingSet(final BindingSet set) {
+ this(set, "");
+ }
+
+ /**
+ * Creates a new {@link VisibilityBindingSet}
+ * @param set - The {@link BindingSet} to decorate
+ * @param visibility - The visibilities on the {@link BindingSet} (not
null)
+ */
+ public VisibilityBindingSet(final BindingSet set, final String
visibility) {
+ super(set);
+ this.visibility = checkNotNull(visibility);
+ }
+
+ /**
+ * @return - The Visibilities on the {@link BindingSet}
+ */
+ public String getVisibility() {
+ return visibility;
+ }
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return true;
+ } else if(o instanceof VisibilityBindingSet) {
+ final VisibilityBindingSet other = (VisibilityBindingSet) o;
+ return set.equals(other) &&
visibility.equals(other.getVisibility());
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
--- End diff --
Do we invoke hashCode often enough that we want to cache the value?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---