1 package org.apache.lucene.facet.index.attributes;
3 import java.io.Serializable;
5 import org.apache.lucene.facet.index.CategoryContainer;
8 * Licensed to the Apache Software Foundation (ASF) under one or more
9 * contributor license agreements. See the NOTICE file distributed with
10 * this work for additional information regarding copyright ownership.
11 * The ASF licenses this file to You under the Apache License, Version 2.0
12 * (the "License"); you may not use this file except in compliance with
13 * the License. You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
25 * Property that can be added to {@link CategoryAttribute}s during indexing.
26 * Note that properties are put in a map and could be shallow copied during
27 * {@link CategoryAttributeImpl#clone()}, therefore reuse of
28 * {@link CategoryProperty} objects is not recommended. Also extends
29 * {@link Serializable}, making the {@link CategoryContainer} serialization more
32 * @lucene.experimental
34 public interface CategoryProperty extends Serializable {
37 * When adding categories with properties to a certain document, it is
38 * possible that the same category will be added more than once with
39 * different instances of the same property. This method defined how to
40 * treat such cases, by merging the newly added property into the one
41 * previously added. Implementing classes can assume that this method will
42 * be called only with a property of the same class.
45 * The category property to merge.
46 * @throws UnsupportedOperationException
47 * If merging is prohibited for this property.
49 public void merge(CategoryProperty other)
50 throws UnsupportedOperationException;