[ https://issues.apache.org/jira/browse/RYA-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15235333#comment-15235333 ]
ASF GitHub Bot commented on RYA-53: ----------------------------------- Github user isper3at commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/36#discussion_r59228867 --- 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 -- probably not a bad call to cache it anyway > Add Visibility to Rya PCJs > -------------------------- > > Key: RYA-53 > URL: https://issues.apache.org/jira/browse/RYA-53 > Project: Rya > Issue Type: New Feature > Reporter: Andrew Smith > > Update the PCJ api to support visibility attached to binding sets -- This message was sent by Atlassian JIRA (v6.3.4#6332)