peer-at-code-parser-java/src/be/jeffcheasey88/peeratcode/parser/java/operation/SynchronizedOperation.java
2023-10-17 04:01:53 +02:00

26 lines
595 B
Java

package be.jeffcheasey88.peeratcode.parser.java.operation;
import java.util.function.Function;
import be.jeffcheasey88.peeratcode.parser.java.JavaElement;
import be.jeffcheasey88.peeratcode.parser.java.Value;
public class SynchronizedOperation extends OperationBag{
private Value value;
public SynchronizedOperation(Value value){
super();
this.value = value;
}
public Value getValue(){
return this.value;
}
@Override
public <E extends JavaElement> E find(Function<JavaElement, Boolean> finder){
if(finder.apply(value)) return (E)value;
return super.find(finder);
}
}