Package org.openrewrite.marker
Class Markers
java.lang.Object
org.openrewrite.marker.Markers
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a new marker element to the collection.addIfAbsent(M m) Add a new marker or update some existing marker.static Markersbuild(Collection<? extends Marker> markers) compute(M identity, BinaryOperator<M> remappingFunction) Add a new marker or update some existing marker.computeByType(M identity, BinaryOperator<M> remappingFunction) Add a new marker or update some existing marker.Collection<? extends Marker>entries()TreeVisitormay respond to a marker to determine whether to act on a source file or not.removeByType(Class<? extends Marker> type) setByType(M m)
-
Field Details
-
EMPTY
-
-
Constructor Details
-
Markers
public Markers()
-
-
Method Details
-
build
-
entries
TreeVisitormay respond to a marker to determine whether to act on a source file or not.- Returns:
- A marker collection containing any additional context about the containing
Treeelement.
-
add
Adds a new marker element to the collection.- Parameters:
marker- The data to add or update.- Returns:
- A new
Markerswith an added marker.
-
computeByType
Add a new marker or update some existing marker.- Type Parameters:
M- The type of marker.- Parameters:
identity- A new marker to add if it doesn't already exist. Existence is determined by type equality.remappingFunction- The function that merges an existing marker.- Returns:
- A new
Markerswith an added or updated marker.
-
removeByType
-
setByType
-
compute
Add a new marker or update some existing marker.- Type Parameters:
M- The type of marker.- Parameters:
identity- A new marker to add if it doesn't already exist. Existence is determined by regular equality.remappingFunction- The function that merges an existing marker with the new marker.- Returns:
- A new
Markerswith an added or updated marker.
-
addIfAbsent
Add a new marker or update some existing marker.- Type Parameters:
M- The marker type.- Parameters:
m- A marker, which may or may not already exist already.- Returns:
- If a marker already exists that matches by object equality, an unchanged markers reference is returned. Otherwise, the supplied marker is added.
-
findAll
-
findFirst
-