All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opencastproject.matterhorn.search.SearchMetadata Maven / Gradle / Ivy

There is a newer version: 9.12
Show newest version
/**
 * Licensed to The Apereo Foundation under one or more contributor license
 * agreements. See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 *
 * The Apereo Foundation licenses this file to you under the Educational
 * Community 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://opensource.org/licenses/ecl2.txt
 *
 * 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.opencastproject.matterhorn.search;

import java.util.List;
import java.util.Map;

/**
 * Resource metadata models a piece of metadata that describes one aspect of a
 * resource, e. g. the title.
 */
public interface SearchMetadata {

  /**
   * Returns the name of this metadata item.
   * 
   * @return the name
   */
  String getName();

  /**
   * Adds value to the list of language neutral values.
   * 
   * @param language
   *          the language
   * @param v
   *          the value
   */
  void addLocalizedValue(Language language, T v);

  /**
   * Returns the values for this metadata item, mapped to their respective
   * languages.
   * 
   * @return the localized values
   */
  Map> getLocalizedValues();

  /**
   * Returns true if this metadata item has been localized.
   * 
   * @return true if the metadata item is localized
   */
  boolean isLocalized();

  /**
   * Adds value to the list of language neutral values.
   * 
   * @param v
   *          the value
   */
  void addValue(T v);

  /**
   * Returns a list of all all non-localized values. In order to retrieve
   * localized values for this metadata field, use {@link #getLocalizedValues()}
   * .
   * 
   * @return the list of language neutral values
   */
  List getValues();

  /**
   * Returns the first value of the available values or null if no
   * value is available.
   * 
   * @return the first value
   * @see #getValues()
   */
  T getValue();

  /**
   * Removes all values currently in the metadata container.
   */
  void clear();

  /**
   * Adds the metadata values to the user facing fulltext index.
   * 
   * @param addToFulltext
   *          true to add the values to the fulltext index
   */
  void setAddToText(boolean addToFulltext);

  /**
   * Returns true if the values should be added to the user facing
   * fulltext search index.
   * 
   * @return true if the metadata values should be added to the
   *         fulltext index
   */
  boolean addToText();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy