li.strolch.search.StrolchValueSearch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agent Show documentation
Show all versions of agent Show documentation
Strolch Agent which is the runtime for Strolch
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);
}
}