mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
use java.util.function.Predicate as api instead of the one from guava
This commit is contained in:
@@ -24,13 +24,8 @@
|
|||||||
|
|
||||||
package sonia.scm.store;
|
package sonia.scm.store;
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A ConfigurationEntryStore can be used to store multiple entries of structured
|
* A ConfigurationEntryStore can be used to store multiple entries of structured
|
||||||
@@ -52,5 +47,5 @@ public interface ConfigurationEntryStore<V> extends DataStore<V> {
|
|||||||
*
|
*
|
||||||
* @return filtered collection of values
|
* @return filtered collection of values
|
||||||
*/
|
*/
|
||||||
public Collection<V> getMatchingValues(Predicate<V> predicate);
|
Collection<V> getMatchingValues(Predicate<V> predicate);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ package sonia.scm.store;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
import com.google.common.collect.Collections2;
|
import com.google.common.collect.Collections2;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -37,7 +36,6 @@ import sonia.scm.xml.XmlStreams;
|
|||||||
|
|
||||||
import javax.xml.bind.JAXBElement;
|
import javax.xml.bind.JAXBElement;
|
||||||
import javax.xml.bind.Marshaller;
|
import javax.xml.bind.Marshaller;
|
||||||
import javax.xml.bind.Unmarshaller;
|
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
import javax.xml.stream.XMLStreamReader;
|
import javax.xml.stream.XMLStreamReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -45,6 +43,7 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -152,7 +151,7 @@ public class JAXBConfigurationEntryStore<V> implements ConfigurationEntryStore<V
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<V> getMatchingValues(Predicate<V> predicate) {
|
public Collection<V> getMatchingValues(Predicate<V> predicate) {
|
||||||
return Collections2.filter(entries.values(), predicate);
|
return Collections2.filter(entries.values(), predicate::test);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void load() {
|
private void load() {
|
||||||
|
|||||||
Reference in New Issue
Block a user