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

li.strolch.search.StrolchValueSearch Maven / Gradle / Ivy

The newest version!
package li.strolch.search;

import static li.strolch.model.StrolchModelConstants.INTERNAL;

import java.util.Collection;
import java.util.stream.Stream;

import li.strolch.model.StrolchModelConstants;
import li.strolch.privilege.model.Restrictable;

public class StrolchValueSearch extends ValueSearch implements Restrictable {

	private String privilegeValue;

	public StrolchValueSearch() {
		this.privilegeValue = getClass().getName();
	}

	/**
	 * @see li.strolch.privilege.model.Restrictable#getPrivilegeName()
	 */
	@Override
	public String getPrivilegeName() {
		return StrolchSearch.class.getName();
	}

	/**
	 * @see li.strolch.privilege.model.Restrictable#getPrivilegeValue()
	 */
	@Override
	public Object getPrivilegeValue() {
		return this.privilegeValue;
	}

	/**
	 * Marks this search as an internal search, thus allowing it to be performed without the authenticated user having
	 * the specific privilege, provided the {@link StrolchModelConstants#INTERNAL} flag is on the search privilege
	 *
	 * @return this object for chaining
	 */
	public StrolchValueSearch internal() {
		this.privilegeValue = INTERNAL;
		return this;
	}

	@Override
	public SearchResult search(Stream stream) {
		return super.search(stream);
	}

	@Override
	public SearchResult search(Collection input) {
		return super.search(input);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy